From 570d47da7fc31c183436291fccb97ff2f9c94439 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. - updates checkout actions to v4 --- .buildkite/pipeline.yml | 15 ------- .github/codecov.yml | 9 +---- .github/workflows/CodeCov.yml | 40 ------------------- .github/workflows/DocCleanup.yml | 2 +- .github/workflows/Invalidations.yml | 4 +- .github/workflows/ci.yml | 8 +++- .github/workflows/docs.yml | 6 ++- .github/workflows/julia_formatter.yml | 10 ++--- .github/workflows/lookahead.yml | 57 +++++++++++++++++++++++++++ config/model_configs/test_env.yml | 4 +- 10 files changed, 80 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/CodeCov.yml create mode 100644 .github/workflows/lookahead.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c55f2ed248..5279bfe36f 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/.github/codecov.yml b/.github/codecov.yml index fab00b9418..1752d124d1 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,11 +1,4 @@ +# Configuration file for codecov. Used to remove some GitHub boxes 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 deleted file mode 100644 index 4fe7a6a86f..0000000000 --- a/.github/workflows/CodeCov.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: CodeCov - -on: - push: - tags: '*' - pull_request: - merge_group: - -jobs: - codecov: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.2.0 - - - name: Set up Julia - uses: julia-actions/setup-julia@latest - with: - version: 1.9 - - - name: Test with coverage - env: - JULIA_PROJECT: "@." - run: | - julia --project=@. -e 'using Pkg; Pkg.instantiate()' - julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)' - - - name: Generate coverage file - env: - JULIA_PROJECT: "@." - run: julia --project=@. -e 'using Pkg; Pkg.add("Coverage"); - using Coverage; - LCOV.writefile("coverage-lcov.info", Codecov.process_folder())' - if: success() - - - name: Submit coverage - uses: codecov/codecov-action@v1.0.7 - with: - token: ${{secrets.CODECOV_TOKEN}} - if: success() diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml index 1568024155..43b39afe0e 100644 --- a/.github/workflows/DocCleanup.yml +++ b/.github/workflows/DocCleanup.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout gh-pages branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: gh-pages diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 9aa4742c52..881ebecdf0 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -19,12 +19,12 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: '1' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-invalidations@v1 id: invs_pr - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.repository.default_branch }} - uses: julia-actions/julia-buildpkg@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0ed8255bd..e0f575d18c 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,13 +18,14 @@ jobs: matrix: version: - '1.9' + - '~1.10.0-rc1' os: - ubuntu-latest - macOS-latest arch: - x64 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -41,3 +46,4 @@ jobs: - uses: codecov/codecov-action@v1 with: file: lcov.info + token: ${{secrets.CODECOV_TOKEN}} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b2ecdad71..e2e6738a86 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,11 +8,15 @@ on: pull_request: merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: docbuild: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: version: 1.9 diff --git a/.github/workflows/julia_formatter.yml b/.github/workflows/julia_formatter.yml index e5dbbc1177..adfe925fc9 100644 --- a/.github/workflows/julia_formatter.yml +++ b/.github/workflows/julia_formatter.yml @@ -6,17 +6,17 @@ 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 + - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2.9.1 id: filter diff --git a/.github/workflows/lookahead.yml b/.github/workflows/lookahead.yml new file mode 100644 index 0000000000..7ee0c825da --- /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@v4 + - 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 9d5345b99b..24b7dc3dbe 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"