From f63f91d6a073be9b9bb21cc3706e84c552bcb636 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Tue, 29 Oct 2024 14:28:38 +0100 Subject: [PATCH] try label arrays --- .github/workflows/oscar-selfhosted.yml | 112 +++++++++++++++++++++++++ test/meta/OscarCI-selfhosted.toml | 21 +++++ 2 files changed, 133 insertions(+) create mode 100644 .github/workflows/oscar-selfhosted.yml create mode 100644 test/meta/OscarCI-selfhosted.toml diff --git a/.github/workflows/oscar-selfhosted.yml b/.github/workflows/oscar-selfhosted.yml new file mode 100644 index 0000000..dd6fce6 --- /dev/null +++ b/.github/workflows/oscar-selfhosted.yml @@ -0,0 +1,112 @@ +name: OscarCI-selfhosted + +on: + pull_request: + branches: + - master + push: + branches: + - master + workflow_dispatch: + +concurrency: + # group by workflow and ref; the last slightly strange component ensures that for pull + # requests, we limit to 1 concurrent job, but for the master branch we don't + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + # Cancel intermediate builds, but only if it is a pull request build. + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + generatematrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + env: + PR_NUMBER: ${{github.event.number || '0' }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: "Set up Julia" + uses: julia-actions/setup-julia@v2 + with: + version: '1.10' + - name: OscarDevTools - CI + if: github.repository == 'oscar-system/OscarDevTools.jl' + run: | + julia --project=oscar-dev -e "using Pkg; + Pkg.develop(PackageSpec(path=\".\")); + Pkg.instantiate();" + - name: fetch OscarDevTools + if: github.repository != 'oscar-system/OscarDevTools.jl' + run: | + julia --project=oscar-dev -e "using Pkg; + Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\")); + Pkg.instantiate();" + - id: set-matrix + run: | + julia --project=oscar-dev -e "using OscarDevTools.OscarCI; + ciprefs = parse_meta(\"test/meta/OscarCI-selfhosted.toml\"); + cimat = ci_matrix(ciprefs; + pr=${PR_NUMBER}, + active_repo=\"${GITHUB_REPOSITORY}\"); + @show cimat; + println(github_json(cimat));" + + test-oscar: + needs: generatematrix + name: ${{ join(matrix.*.name) }} - ${{ matrix.os }}, julia ${{ matrix.julia-version}} + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.julia-version == 'nightly' }} + env: + PR_NUMBER: ${{github.event.number}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + strategy: + matrix: ${{fromJSON(needs.generatematrix.outputs.matrix)}} + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - name: "Set up Julia" + uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.julia-version }} + - name: re-using OscarDevTools checkout + if: github.repository == 'oscar-system/OscarDevTools.jl' + run: | + julia --project=oscar-dev -e "using Pkg; + Pkg.develop(PackageSpec(path=\".\")); + Pkg.instantiate();" + - name: fetch OscarDevTools + if: github.repository != 'oscar-system/OscarDevTools.jl' + run: | + julia --project=oscar-dev -e "using Pkg; + Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\")); + Pkg.instantiate();" + - name: "Set up Oscar-dev configuration" + id: setupdev + env: + MATRIX_CONTEXT: ${{ toJSON(matrix) }} + run: | + echo "$MATRIX_CONTEXT" + julia --project=oscar-dev -e "using OscarDevTools, OscarDevTools.OscarCI; + meta = job_meta_env(\"MATRIX_CONTEXT\"); + oscar_develop(job_pkgs(meta); + dir=\"oscar-dev\", + active_repo=\"${GITHUB_REPOSITORY}\"); + github_env_runtests(meta; + varname=\"oscar_run_tests\", + filename=\"${GITHUB_ENV}\"); + github_env_run_doctests(meta; + varname=\"oscar_run_doctests\", + filename=\"${GITHUB_ENV}\");" + + - name: "Run tests" + if: steps.setupdev.outputs.skiptests != 'true' + run: | + echo '${{ env.oscar_run_tests }}' + julia --project=oscar-dev/project/ -e '${{ env.oscar_run_tests }}' + - name: "Run doctests" + if: steps.setupdev.outputs.skiptests != 'true' + run: | + echo '${{ env.oscar_run_doctests }}' + julia --project=oscar-dev/project/ -e '${{ env.oscar_run_doctests }}' diff --git a/test/meta/OscarCI-selfhosted.toml b/test/meta/OscarCI-selfhosted.toml new file mode 100644 index 0000000..7ca59a7 --- /dev/null +++ b/test/meta/OscarCI-selfhosted.toml @@ -0,0 +1,21 @@ +title = "metadata for oscar CI run" + +# defaults for os, julia-version, and branches are set in OscarDevTools +# '' will try to look up a matching branch for the branch of +# the pull request and use master if that cannot be found +[env] +os = [ [ "Linux", "RPTU" ], "ubuntu-latest" ] +julia-version = [ "~1.10.0-0" ] +branches = [ "" ] + +# pkgs without branches specified will use the global branches axis +# and not expand separately +[pkgs] + [pkgs.Oscar] + test = true + testoptions = [] + + [pkgs.Singular] + branches = [] + test = true + testoptions = []