Skip to content

Commit

Permalink
Per #2760, add new compiling workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 14, 2023
1 parent 586573d commit 062ffeb
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg SOURCE_BRANCH \
--build-arg MET_BASE_REPO \
--build-arg MET_BASE_TAG \
--build-arg MET_ENABLE_OPTS \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
cat ${GITHUB_WORKSPACE}/docker_build.log
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/compiling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Compiling

# Test MET configuration options for all tags

on:

push:
tags:
- 'v**'
paths-ignore:
- 'docs/**'
- '.github/pull_request_template.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/labels/**'
- '**/README.md'
- '**/LICENSE.md'

workflow_dispatch:

jobs:

compile:
name: Compile MET enable options
runs-on: ubuntu-latest
strategy:
matrix:
enable_opts:
- ''
- '--enable-all'
- '--enable-grib2'
- '--enable-python'
- '--enable-ugrid'
- '--enable-lidar2nc'
- '--enable-mode_graphics'
- '--enable-modis'
fail-fast: false
steps:
- uses: actions/checkout@v3

- name: Create directories to store output
run: mkdir -p ${RUNNER_WORKSPACE}/logs

- name: Compile MET in Docker
run: .github/jobs/build_docker_image.sh
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }}
MET_BASE_TAG: ${{ needs.job_control.outputs.met_base_tag }}
MET_ENABLE_OPTS: ${{ matrix.enable_opts }}

- name: Copy all build log files into logs directory
if: always()
run: cp ${GITHUB_WORKSPACE}/*.log ${RUNNER_WORKSPACE}/logs/

- name: Upload logs as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: logs
path: ${{ runner.workspace }}/logs
if-no-files-found: ignore

8 changes: 7 additions & 1 deletion internal/scripts/docker/build_met_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if [ -z ${MET_GIT_NAME+x} ]; then
echo "Setting MET_GIT_NAME=${MET_GIT_NAME} based on the current branch."
fi

# Check whether MET_ENABLE_OPTS is defined
if [ -z ${MET_ENABLE_OPTS+x} ]; then
MET_ENABLE_OPTS='--enable-all'
echo "Setting MET_ENABLE_OPTS=${MET_ENABLE_OPTS} to compile all available options."
fi

# Create log directory
mkdir -p /met/logs

Expand All @@ -19,7 +25,7 @@ echo "Running bootstrap for MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}
echo "Configuring MET ${MET_GIT_NAME} and appending to log file ${LOG_FILE}"
./configure \
BUFRLIB_NAME=${BUFRLIB_NAME} GRIB2CLIB_NAME=${GRIB2CLIB_NAME} \
--enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python --enable-ugrid \
${MET_ENABLE_OPTS} \
CPPFLAGS="-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/cairo" \
LIBS="-ltirpc" >> ${LOG_FILE} 2>&1
if [ $? != 0 ]; then
Expand Down

0 comments on commit 062ffeb

Please sign in to comment.