From fcbccb9fa44081369cdf8c99c337a848de3385e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Wed, 26 Jul 2023 16:57:13 +0200 Subject: [PATCH] Add tests against Oscar master (#122) --- .github/workflows/OscarTests.yml | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/OscarTests.yml diff --git a/.github/workflows/OscarTests.yml b/.github/workflows/OscarTests.yml new file mode 100644 index 0000000..51dea21 --- /dev/null +++ b/.github/workflows/OscarTests.yml @@ -0,0 +1,91 @@ +name: Run tests with Oscar master + +on: + push: + branches: + - master + pull_request: + 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: + oscartest: + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + continue-on-error: ${{ matrix.julia-version == 'nightly' }} + strategy: + fail-fast: false + matrix: + julia-version: + - '1.6' + - '1.8' + - '1.9' + - 'nightly' + julia-arch: + - x64 + os: + - ubuntu-latest + # include: + # Add a few macOS jobs (not too many, the number we can run in parallel is limited) + # - julia-version: '1.6' + # julia-arch: x64 + # os: macOS-latest + # - julia-version: 'nightly' + # julia-arch: x64 + # os: macOS-latest + + steps: + - uses: actions/checkout@v3 + with: + # For Codecov, we must also fetch the parent of the HEAD commit to + # be able to properly deal with PRs / merges + fetch-depth: 2 + + - name: "Set up Julia" + uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.julia-version }} + arch: ${{ matrix.julia-arch }} + + - name: Restore cache + uses: julia-actions/cache@v1 + with: + cache-name: 'oscartest-${{ matrix.julia-version }}-${{ matrix.os }}-${{ matrix.julia-arch }}' + + - name: "Clone Oscar.jl" + run: | + git clone --branch master-pbwdeformations https://github.com/lgoettgens/Oscar.jl oscar-dev/Oscar.jl + echo "Checking out Oscar.jl commit:" + git show --oneline -s + + - name: "Dev Oscar.jl" + run: | + using Pkg + Pkg.develop(PackageSpec(path="oscar-dev/Oscar.jl")) + shell: julia --color=yes --project=. {0} + + - name: "Build package" + uses: julia-actions/julia-buildpkg@latest + + # - name: "limit OpenMP threads" + # if: runner.os == 'macOS' + # # restrict number of openMP threads on macOS due to oversubscription + # run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV + + - name: "Run tests" + uses: julia-actions/julia-runtest@latest + + - name: "Process code coverage" + uses: julia-actions/julia-processcoverage@v1 + + - name: "Upload coverage data to Codecov" + continue-on-error: true + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }}