From 5e33f4517a4d4fa2cf87c01018a392404cfaab9a Mon Sep 17 00:00:00 2001 From: Gabriele Bozzola Date: Tue, 28 Nov 2023 15:23:14 -0800 Subject: [PATCH] Clean up Github Actions/buildkite This PR: - ensures that Github action workflows are killed when a new commit is pushed to the same branch/PR (following https://stackoverflow.com/a/67939898) - removes the need for the test environment from builkite jobs. The test environment is used only for one job. When the depot is cold, instantiating the test environment takes several minutes (when we have a good depot it takes 1-2 minutes). Given that instantiating the environment has to run before all the tests, this leads to unnecessary latency. - adds a new GitHub workflow 'lookahead'. The lookahead workflow is non-required to merge PRs and runs tests and one simulation (the one removed from the buildkite run) with julia 1.9 and julia 1.10 and the latest dependencies. - removes a stray file (codecov.yml) --- .buildkite/pipeline.yml | 15 ------- .codecov.yml | 3 ++ .github/codecov.yml | 11 ------ .github/workflows/CodeCov.yml | 4 ++ .github/workflows/ci.yml | 5 +++ .github/workflows/docs.yml | 4 ++ .github/workflows/julia_formatter.yml | 8 ++-- .github/workflows/lookahead.yml | 57 +++++++++++++++++++++++++++ config/model_configs/test_env.yml | 4 +- 9 files changed, 79 insertions(+), 32 deletions(-) create mode 100644 .codecov.yml delete mode 100644 .github/codecov.yml create mode 100644 .github/workflows/lookahead.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c55f2ed2481..5279bfe36fc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -36,12 +36,6 @@ steps: - "julia --project -e 'using Pkg; Pkg.precompile()'" - "julia --project -e 'using Pkg; Pkg.status()'" - - echo "--- Instantiate test" - - "julia --project=test -e 'using Pkg; Pkg.develop(path = \".\")'" - - "julia --project=test -e 'using Pkg; Pkg.instantiate(;verbose=true)'" - - "julia --project=test -e 'using Pkg; Pkg.precompile()'" - - "julia --project=test -e 'using Pkg; Pkg.status()'" - - echo "--- Instantiate examples" - "julia --project=examples -e 'using Pkg; Pkg.instantiate(;verbose=true)'" - "julia --project=examples -e 'using Pkg; Pkg.precompile()'" @@ -512,15 +506,6 @@ steps: --config_file $CONFIG_PATH/test_io.yml artifact_paths: "test_io/*" - - label: ":computer: Use test env with latest deps" - command: > - julia --color=yes --project=test examples/hybrid/driver.jl - --config_file $CONFIG_PATH/test_env.yml - artifact_paths: "test_env/*" - soft_fail: true - agents: - slurm_mem: 20GB - - label: ":computer: MPI io test" command: > srun julia --color=yes --project=examples examples/hybrid/driver.jl diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000000..99c9adaa5df --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,3 @@ +comment: false +github_checks: + annotations: false diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index fab00b9418b..00000000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,11 +0,0 @@ -comment: false -coverage: - status: - project: - default: - target: auto - # this allows a 10% drop from the previous base commit coverage - threshold: 10% - -github_checks: - annotations: false diff --git a/.github/workflows/CodeCov.yml b/.github/workflows/CodeCov.yml index 4fe7a6a86fb..a844c20c822 100644 --- a/.github/workflows/CodeCov.yml +++ b/.github/workflows/CodeCov.yml @@ -6,6 +6,10 @@ on: pull_request: merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: codecov: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0ed8255bd4..f414874cf64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,10 @@ on: pull_request: merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: ci ${{ matrix.version }} - ${{ matrix.os }} @@ -14,6 +18,7 @@ jobs: matrix: version: - '1.9' + - '~1.10.0-rc1' os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b2ecdad712..5198e40ee6a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,6 +8,10 @@ on: pull_request: merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: docbuild: runs-on: ubuntu-latest diff --git a/.github/workflows/julia_formatter.yml b/.github/workflows/julia_formatter.yml index e5dbbc1177d..2ceecca3c58 100644 --- a/.github/workflows/julia_formatter.yml +++ b/.github/workflows/julia_formatter.yml @@ -6,15 +6,15 @@ on: pull_request: merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: format: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - uses: actions/checkout@v2.2.0 diff --git a/.github/workflows/lookahead.yml b/.github/workflows/lookahead.yml new file mode 100644 index 00000000000..fd12f79b171 --- /dev/null +++ b/.github/workflows/lookahead.yml @@ -0,0 +1,57 @@ +name: lookahead + +# This action sets up a couple of tests for newer versions of julia and for +# dependencies more recent than the one in examples so that one can see if there +# are upcoming problems. + +on: + push: + tags: '*' + pull_request: + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: ci ${{ matrix.version }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + version: + - '1.9' + - '~1.10.0-rc1' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - name: Instantiate test env + run: | + julia --project=test -e "using Pkg; Pkg.instantiate(); Pkg.develop(path=\".\")" + - name: Run test_env.yml + continue-on-error: true + run: | + julia --project=test examples/hybrid/driver.jl --config_file config/model_configs/test_env.yml + - name: Run tests + run: | + julia --project=test test/runtests.jl diff --git a/config/model_configs/test_env.yml b/config/model_configs/test_env.yml index 9d5345b99b3..24b7dc3dbe7 100644 --- a/config/model_configs/test_env.yml +++ b/config/model_configs/test_env.yml @@ -7,6 +7,6 @@ precip_model: "0M" dt: "1secs" t_end: "10secs" dt_save_to_sol: "Inf" -z_elem: 25 -h_elem: 12 +z_elem: 20 +h_elem: 8 dt_rad: "5secs"