From 6140f9320e09cf0eeb3dd8362a01bcb341884bf8 Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Wed, 25 Sep 2024 15:50:45 -0400 Subject: [PATCH] Add downstream tests --- .github/workflows/Downstream.yml | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/Downstream.yml diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml new file mode 100644 index 00000000..0aba6489 --- /dev/null +++ b/.github/workflows/Downstream.yml @@ -0,0 +1,57 @@ +name: Downstream +on: + push: + branches: + - main + tags: '*' + pull_request: + +# Needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: downstream ${{ matrix.package }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + package: + - 'ClimaAtmos.jl' + - 'ClimaCoupler.jl' + - 'ClimaDiagnostics.jl' + - 'ClimaLand.jl' + - 'KinematicDriver.jl' + - 'ClimaDiagnostics.jl' + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: '1.10' + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: actions/checkout@v4 + with: + repository: 'CliMA/${{ matrix.package }}' + path: ${{ matrix.package }} + + # The test suite for ClimaTimesteppers depends on ClimaCore, not + # ClimaTimesteppers itself. If we dev-ed ClimaCore in ClimaTimesteppers, + # the aqua test would fail because we never use ClimaCore. + - if: matrix.package != 'ClimaTimesteppers.jl' + run: | + julia --color=yes --project=${{ matrix.package }} -e 'using Pkg; Pkg.instantiate()' + julia --color=yes --project=${{ matrix.package }} -e 'using Pkg; Pkg.develop(; path = ".")' + julia --color=yes --project=${{ matrix.package }} -e 'using Pkg; Pkg.test()' + + - if: matrix.package == 'ClimaTimesteppers.jl' + run: | + julia --color=yes --project=ClimaTimesteppers.jl/test -e 'using Pkg; Pkg.instantiate()' + julia --color=yes --project=ClimaTimesteppers.jl/test -e 'using Pkg; Pkg.develop(; path = ".")' + julia --color=yes --project=ClimaTimesteppers.jl/test ClimaTimesteppers.jl/test/runtests.jl