Run tests #23498
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'release-*' | |
| paths-ignore: | |
| - '*.md' | |
| - '.github/workflows/changelog.yml' | |
| - 'dev/releases/release_notes.py' | |
| pull_request: | |
| paths-ignore: | |
| - '*.md' | |
| - '.github/workflows/changelog.yml' | |
| - 'dev/releases/release_notes.py' | |
| schedule: | |
| # Every day at 3:10 AM UTC | |
| - cron: '10 3 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| extralong: | |
| type: boolean | |
| default: false | |
| description: Run extra long test set | |
| # needed to allow julia-actions/cache to delete old caches that it has created | |
| permissions: | |
| actions: write | |
| contents: read | |
| 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: | |
| test: | |
| runs-on: ["${{ matrix.os }}", "${{ matrix.group == 'short' && 'high-memory' || 'normal-memory'}}", RPTU] | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: | |
| - '1.10' | |
| - '1.11' | |
| - '1.12' | |
| - '1.13-nightly' | |
| - 'nightly' | |
| group: [ 'short', 'long' ] | |
| os: [Linux] | |
| depwarn: [ '' ] | |
| include: | |
| # Add a single job per group with deprecation errors on the most recent stable julia version | |
| - julia-version: '1.10' | |
| group: 'short' | |
| os: [Linux, RPTU, high-memory] | |
| depwarn: 'depwarn=error' | |
| - julia-version: '1.10' | |
| group: 'long' | |
| os: [Linux, RPTU, normal-memory] | |
| depwarn: 'depwarn=error' | |
| # Add a few macOS jobs (not too many, the number we can run in parallel is limited) | |
| - julia-version: '1.10' | |
| group: 'short' | |
| os: [macOS, RPTU] # runs on self-hosted runner | |
| - julia-version: '1.10' | |
| group: 'long' | |
| os: [macOS, RPTU] # runs on self-hosted runner | |
| # nightly on macos is disabled for now since the macos jobs take too long | |
| # with just 5 runners | |
| #- julia-version: 'nightly' | |
| # group: 'short' | |
| # os: macOS-latest | |
| #- julia-version: 'nightly' | |
| # group: 'long' | |
| # os: macOS-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| 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" | |
| id: setup-julia | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - uses: julia-actions/cache@v2 | |
| id: julia-cache | |
| if: runner.environment != 'self-hosted' | |
| with: | |
| cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
| include-matrix: false | |
| - name: "Build package" | |
| uses: julia-actions/julia-buildpkg@v1 | |
| - 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: "Use multiple processes for self-hosted macOS runners" | |
| if: runner.os == 'macOS' && runner.environment == 'self-hosted' | |
| # runner.environment is supposed to be a valid property: https://github.com/orgs/community/discussions/48359#discussioncomment-9059557 | |
| run: echo "NUMPROCS=5" >> $GITHUB_ENV | |
| - name: "set test subgroup" | |
| if: ${{ matrix.group }} != '' | |
| run: echo "OSCAR_TEST_SUBSET=${{matrix.group}}" >> $GITHUB_ENV | |
| - name: "Run tests" | |
| uses: julia-actions/julia-runtest@latest | |
| with: | |
| annotate: ${{ matrix.julia-version == '1.10' }} | |
| coverage: ${{ matrix.julia-version == '1.10' }} | |
| depwarn: ${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }} | |
| - name: "Process code coverage" | |
| if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error' | |
| uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: src,experimental | |
| - name: "Upload coverage data to Codecov" | |
| if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error' | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Save Julia depot cache on cancel or failure | |
| id: julia-cache-save | |
| if: (cancelled() || failure()) && runner.environment != 'self-hosted' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ${{ steps.julia-cache.outputs.cache-paths }} | |
| key: ${{ steps.julia-cache.outputs.cache-key }} | |
| book-tests: | |
| runs-on: 'ubuntu-latest' | |
| timeout-minutes: 80 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: | |
| - '1.10' | |
| - 'pre' | |
| - 'nightly' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| 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" | |
| id: setup-julia | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - uses: julia-actions/cache@v2 | |
| id: julia-cache | |
| if: runner.environment != 'self-hosted' | |
| with: | |
| cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
| include-matrix: false | |
| - name: "Build package" | |
| uses: julia-actions/julia-buildpkg@v1 | |
| - name: "set test subgroup" | |
| run: echo "OSCAR_TEST_SUBSET=book" >> $GITHUB_ENV | |
| - name: "Run tests" | |
| uses: julia-actions/julia-runtest@latest | |
| with: | |
| annotate: ${{ matrix.julia-version == '1.10' }} | |
| coverage: ${{ matrix.julia-version == '1.10' }} | |
| - name: "Process code coverage" | |
| if: matrix.julia-version == '1.10' | |
| uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: src,experimental | |
| - name: "Upload coverage data to Codecov" | |
| if: matrix.julia-version == '1.10' | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Save Julia depot cache on cancel or failure | |
| id: julia-cache-save | |
| if: (cancelled() || failure()) && runner.environment != 'self-hosted' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ${{ steps.julia-cache.outputs.cache-paths }} | |
| key: ${{ steps.julia-cache.outputs.cache-key }} | |
| extra-long-test: | |
| # Extra long tests | |
| # Only happens during the daily run, triggered by schedule | |
| if: ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.extralong ) || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extra-long') ) }} | |
| runs-on: [Linux, RPTU, normal-memory] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: "Set up Julia" | |
| id: setup-julia | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "1.10" | |
| - name: "Build package" | |
| uses: julia-actions/julia-buildpkg@v1 | |
| - name: "set test subgroup" | |
| run: echo "OSCAR_TEST_SUBSET=extra_long" >> $GITHUB_ENV | |
| - name: "Run tests" | |
| uses: julia-actions/julia-runtest@latest | |
| doctest: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: | |
| - '1.10' | |
| - '1.11' | |
| - '1.12' | |
| - '1.13-nightly' | |
| - 'nightly' | |
| os: | |
| - 'ubuntu-latest' | |
| depwarn: [ '' ] | |
| include: | |
| # Add a single job with deprecation errors on the most recent stable julia version | |
| - julia-version: '1.10' | |
| os: 'ubuntu-latest' | |
| depwarn: 'depwarn=error' | |
| # Add macOS jobs (not too many, the number we can run in parallel is limited) | |
| - julia-version: '1.10' | |
| os: [macOS, RPTU] # runs on self hosted runner | |
| steps: | |
| - uses: actions/checkout@v5 | |
| 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@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - uses: julia-actions/cache@v2 | |
| id: julia-cache | |
| if: runner.environment != 'self-hosted' | |
| with: | |
| cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
| include-matrix: false | |
| - name: "Build package" | |
| uses: julia-actions/julia-buildpkg@v1 | |
| - 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: "Setup package" | |
| run: | | |
| julia --project=docs --color=yes -e ' | |
| using Pkg | |
| Pkg.develop(PackageSpec(path=pwd())) | |
| Pkg.instantiate()' | |
| - name: "Run doctests" | |
| run: | | |
| julia ${{ matrix.julia-version == '1.10' && '--code-coverage' || '' }} \ | |
| --project=docs --depwarn=${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }} --color=yes -e' | |
| using Documenter | |
| include("docs/documenter_helpers.jl") | |
| using Oscar | |
| DocMeta.setdocmeta!(Oscar, :DocTestSetup, Oscar.doctestsetup(); recursive = true) | |
| doctest(Oscar; doctestfilters=Oscar.doctestfilters())' | |
| - name: "Process code coverage" | |
| if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error' | |
| uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: src,experimental | |
| - name: "Upload coverage data to Codecov" | |
| if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error' | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Save Julia depot cache on cancel or failure | |
| id: julia-cache-save | |
| if: (cancelled() || failure()) && runner.environment != 'self-hosted' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ${{ steps.julia-cache.outputs.cache-paths }} | |
| key: ${{ steps.julia-cache.outputs.cache-key }} | |
| test-mongodb: | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: ${{ contains(matrix.julia-version, 'nightly') }} | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: | |
| - '1.10' | |
| - '1.11' | |
| - '1.12' | |
| - '1.13-nightly' | |
| - 'nightly' | |
| os: ['ubuntu-latest'] | |
| # Service containers to run | |
| services: | |
| # Label used to access the service container | |
| mongodb: | |
| # Docker Hub image | |
| image: mongo:6.0 | |
| # Provide the login data | |
| env: | |
| MONGO_INITDB_ROOT_USERNAME: admin | |
| MONGO_INITDB_ROOT_PASSWORD: admin | |
| ports: | |
| # Maps tcp port 27017 on service container to the host | |
| - 27017:27017 | |
| env: | |
| JULIA_PKG_SERVER: "" | |
| OSCARDB_TEST_URI: "mongodb://admin:admin@localhost:27017/?authSource=admin" | |
| OSCAR_TEST_SUBSET: "oscar_db" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: "Set up Julia" | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - uses: julia-actions/cache@v2 | |
| with: | |
| cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }} | |
| include-matrix: false | |
| cache-scratchspaces: false | |
| - name: "Fill OscarDB container" | |
| run: | | |
| wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - | |
| echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-database-tools | |
| mongorestore --host localhost -u admin -p admin --port 27017 .github/oscardb_dump | |
| - uses: julia-actions/julia-runtest@v1 | |
| with: | |
| annotate: ${{ matrix.julia-version == '1.10' }} | |
| coverage: ${{ matrix.julia-version == '1.10' }} | |
| - name: "Process code coverage" | |
| if: matrix.julia-version == '1.10' | |
| uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: src,experimental | |
| - name: "Upload coverage data to Codecov" | |
| if: matrix.julia-version == '1.10' | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # adapted from gap-system/gap | |
| slack-notification: | |
| name: Send Slack notification on status change | |
| needs: | |
| - extra-long-test | |
| if: github.event_name == 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get branch name | |
| id: get-branch | |
| run: echo "branch=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
| - name: Determine whether CI status changed | |
| uses: oscar-system/should-i-notify-action@v1 | |
| id: should_notify | |
| with: | |
| branch: ${{ steps.get-branch.outputs.branch }} | |
| needs_context: ${{ toJson(needs) }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| notify_on_changed_status: '' # notify each time on failure, and also once when the status changes to success | |
| event: ${{ github.event_name }} | |
| - name: Send slack notification | |
| uses: act10ns/slack@v2 | |
| if: ${{ steps.should_notify.outputs.should_send_message == 'yes' }} | |
| with: | |
| status: ${{ steps.should_notify.outputs.current_status }} | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |