From feca3f0a76ec00573d42573d00dce64f3ddf271d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 4 May 2023 10:17:02 +0000 Subject: [PATCH] GitHub workflows --- .github/.cmake-options | 2 +- .github/ci-nightly-test.sh | 19 +++++++++++++++++++ .github/workflows/ci.yml | 9 +++++++++ .github/workflows/nightly.yml | 16 ++++++++++++++++ .github/workflows/reusable-ci-hpc.yml | 10 ++++++++++ .github/workflows/reusable-ci.yml | 5 +++++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/ci-nightly-test.sh create mode 100644 .github/workflows/nightly.yml diff --git a/.github/.cmake-options b/.github/.cmake-options index 213b78382..05fc1f6c2 100644 --- a/.github/.cmake-options +++ b/.github/.cmake-options @@ -1 +1 @@ --DENABLE_EXTRA_TESTS=1 +-DENABLE_EXTRA_TESTS=1 -DECCODES_INSTALL_EXTRA_TOOLS=1 diff --git a/.github/ci-nightly-test.sh b/.github/ci-nightly-test.sh new file mode 100644 index 000000000..3ee9b739f --- /dev/null +++ b/.github/ci-nightly-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +# We do not want to come across the ecCodes tools in the toolbox +module unload ecmwf-toolbox + +module load cdo/new +module load numdiff +module load nccmp +module load netcdf4/new +module load gnuparallel/new +module load python3 + +cd ~masn/REGRESSION_TESTING/ecCodes +./par-suite.sh -w $TMPDIR/install/eccodes + +# For debugging specific test(s) +# ./seq-suite.sh -w $TMPDIR/install/eccodes -d -t py_ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99f2ffff4..7b347d5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,3 +73,12 @@ jobs: repository: private-downstream-ci event_type: downstream-ci-hpc payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' + + codecov: + name: code-coverage + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + uses: ./.github/workflows/reusable-ci.yml + with: + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + codecov: true + secrets: inherit diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..a40ef52ee --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,16 @@ +name: nightly + +on: + workflow_dispatch: ~ + + # Run at 20:00 UTC every day (on default branch) + schedule: + - cron: '0 20 * * *' + +jobs: + test: + uses: ./.github/workflows/reusable-ci-hpc.yml + with: + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + nightly_test: true + secrets: inherit diff --git a/.github/workflows/reusable-ci-hpc.yml b/.github/workflows/reusable-ci-hpc.yml index 3db33f2d2..793f26ebe 100644 --- a/.github/workflows/reusable-ci-hpc.yml +++ b/.github/workflows/reusable-ci-hpc.yml @@ -6,6 +6,10 @@ on: eccodes: required: false type: string + nightly_test: + required: false + type: boolean + default: false jobs: ci-hpc: @@ -19,5 +23,11 @@ jobs: ecbuild ninja aec + netcdf4/new --parallel: 64 + --cmake-options: | + -DENABLE_EXTRA_TESTS=1 + ${{ inputs.nightly_test && '-DENABLE_PNG=1,-DENABLE_NETCDF=1' || '' }} + ${{ inputs.nightly_test && '--post-script: .github/ci-nightly-test.sh' || '' }} + ${{ inputs.nightly_test && '--force-build: true' || '' }} secrets: inherit diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 79f4cf53b..25cc1765e 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -6,6 +6,10 @@ on: eccodes: required: false type: string + codecov: + required: false + type: boolean + default: false jobs: ci: @@ -14,6 +18,7 @@ jobs: with: repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} name_prefix: eccodes- + codecov_upload: ${{ inputs.codecov }} build_package_inputs: | repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} self_coverage: true