simplified Cartesian*UnitorInverse and Cocartesian*Unitor #6000
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| - "*-ci" | |
| pull_request: | |
| schedule: | |
| - cron: "0 4 * * *" # after gap-docker(-master) is rebuilt | |
| workflow_dispatch: | |
| # cancel runs for pull requests on force push | |
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}-${{ github.run_attempt }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ── Clone packages and build reference documentation once per image ───────────────────── | |
| prepare-deps: | |
| strategy: | |
| matrix: | |
| image: ["ghcr.io/homalg-project/gap-docker:latest", "ghcr.io/homalg-project/gap-docker-master:latest"] | |
| fail-fast: false | |
| name: Build docs (${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }}) | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.image }} | |
| defaults: | |
| run: | |
| working-directory: /home/gap/.gap/pkg/ | |
| env: | |
| HOME: /home/gap | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Move checked out repo to GAP user root dir | |
| run: | | |
| cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ | |
| - name: Clone dependencies | |
| run: | | |
| cp ./CAP_project/dev/ci_gaprc /home/gap/.gap/gaprc | |
| git clone --depth 1 -vv https://github.com/homalg-project/homalg_project.git | |
| git clone --depth 1 -vv https://github.com/homalg-project/ToricVarieties.git | |
| - name: Build documentation of packages which we might want to reference | |
| run: | | |
| # keep this in sync with `dev/.release` | |
| if [ -d "CAP_project/CAP" ]; then make -C "CAP_project/CAP" doc; fi | |
| if [ -d "CAP_project/CompilerForCAP" ]; then make -C "CAP_project/CompilerForCAP" doc; fi | |
| if [ -d "CAP_project/MonoidalCategories" ]; then make -C "CAP_project/MonoidalCategories" doc; fi | |
| if [ -d "CAP_project/CartesianCategories" ]; then make -C "CAP_project/CartesianCategories" doc; fi | |
| if [ -d "CAP_project/AdditiveClosuresForCAP" ]; then make -C "CAP_project/AdditiveClosuresForCAP" doc; fi | |
| if [ -d "CAP_project/FreydCategoriesForCAP" ]; then make -C "CAP_project/FreydCategoriesForCAP" doc; fi | |
| if [ -d "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" ]; then make -C "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" doc; fi | |
| if [ -d "homalg_project/homalg" ]; then make -C "homalg_project/homalg" doc; fi | |
| if [ -d "homalg_project/Modules" ]; then make -C "homalg_project/Modules" doc; fi | |
| if [ -d "CategoricalTowers/ToolsForCategoricalTowers" ]; then make -C "CategoricalTowers/ToolsForCategoricalTowers" doc; fi | |
| if [ -d "CategoricalTowers/Toposes" ]; then make -C "CategoricalTowers/Toposes" doc; fi | |
| - name: Package dependencies | |
| run: | | |
| tar cf /tmp/deps.tar --exclude='.git' \ | |
| homalg_project/ \ | |
| ToricVarieties/ \ | |
| CAP_project/CAP/doc/ \ | |
| CAP_project/CompilerForCAP/doc/ \ | |
| CAP_project/MonoidalCategories/doc/ \ | |
| CAP_project/CartesianCategories/doc/ \ | |
| CAP_project/AdditiveClosuresForCAP/doc/ \ | |
| CAP_project/FreydCategoriesForCAP/doc/ | |
| - name: Upload deps artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: deps-${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }} | |
| path: /tmp/deps.tar | |
| retention-days: 1 | |
| # ── Per-package test jobs (run in parallel) ────────────────────────── | |
| test: | |
| needs: prepare-deps | |
| strategy: | |
| matrix: | |
| image: ["ghcr.io/homalg-project/gap-docker:latest", "ghcr.io/homalg-project/gap-docker-master:latest"] | |
| config: | |
| - { packages: [CAP, ActionsForCAP, AttributeCategoryForCAP, GroupRepresentationsForCAP, GroupsAsCategoriesForCAP] } | |
| - { packages: [CartesianCategories, MonoidalCategories] } | |
| - { packages: [ComplexesAndFilteredObjectsForCAP, InternalExteriorAlgebraForCAP, HomologicalAlgebraForCAP, GeneralizedMorphismsForCAP, ToricSheaves] } | |
| - { packages: [CompilerForCAP] } | |
| - { packages: [LinearAlgebraForCAP, LinearClosuresForCAP, AdditiveClosuresForCAP, FreydCategoriesForCAP] } | |
| - { packages: [ModulesOverLocalRingsForCAP, ModulePresentationsForCAP, GradedModulePresentationsForCAP] } | |
| fail-fast: false | |
| name: ${{ matrix.config.targets && format('{0}_{1}', matrix.config.package, join(matrix.config.targets, '_')) || matrix.config.package || join(matrix.config.packages, '_') }} (${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }}) | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.image }} | |
| defaults: | |
| run: | |
| working-directory: /home/gap/.gap/pkg/ | |
| env: | |
| HOME: /home/gap | |
| steps: | |
| - name: Keep workflow active even if repository has no activity for 60 days | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| curl --fail -X PUT -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/Tests.yml/enable" | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Move checked out repo to GAP user root dir | |
| run: | | |
| cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ | |
| - name: Download pre-built dependencies | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: deps-${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }} | |
| path: /tmp/ | |
| - name: Extract dependencies | |
| run: | | |
| tar xf /tmp/deps.tar | |
| cp ./CAP_project/dev/ci_gaprc /home/gap/.gap/gaprc | |
| - name: Test ${{ matrix.config.targets && format('{0}_{1}', matrix.config.package, join(matrix.config.targets, '_')) || matrix.config.package || join(matrix.config.packages, '_') }} | |
| run: | | |
| PACKAGES="${{ matrix.config.package || join(matrix.config.packages, ' ') }}" | |
| TARGETS="${{ join(matrix.config.targets, ' ') }}" | |
| for pkg in $PACKAGES; do | |
| if [ -z "$TARGETS" ]; then | |
| make -C "CAP_project/$pkg" --trace ci-test | |
| else | |
| for tgt in $TARGETS; do | |
| if [ "$tgt" = "base" ]; then | |
| make -C "CAP_project/$pkg" --trace ci-test-base | |
| else | |
| make -C "CAP_project/$pkg" --trace ci-test-single "TST_ID=$tgt" | |
| fi | |
| done | |
| fi | |
| done | |
| - name: Process coverage files | |
| if: always() && matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' | |
| run: | | |
| cd CAP_project | |
| python3 dev/process_coverage.py | |
| - name: Collect coverage files | |
| if: always() && github.event_name != 'schedule' && matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' | |
| run: | | |
| mkdir -p /tmp/coverage-collect | |
| for pkg in ${{ matrix.config.package || join(matrix.config.packages, ' ') }}; do | |
| mkdir -p "/tmp/coverage-collect/$pkg" | |
| cp "CAP_project/$pkg"/coverage*.json "/tmp/coverage-collect/$pkg/" 2>/dev/null || true | |
| done | |
| - name: Upload coverage artifact | |
| if: always() && github.event_name != 'schedule' && matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ matrix.config.targets && format('{0}_{1}', matrix.config.package, join(matrix.config.targets, '_')) || matrix.config.package || join(matrix.config.packages, '_') }} | |
| path: /tmp/coverage-collect/ | |
| if-no-files-found: ignore | |
| retention-days: 1 | |
| # ── Release / simulate release ─────────────────────────────────────── | |
| release: | |
| needs: [prepare-deps, test] | |
| if: always() && !cancelled() | |
| strategy: | |
| matrix: | |
| image: ["ghcr.io/homalg-project/gap-docker:latest", "ghcr.io/homalg-project/gap-docker-master:latest"] | |
| fail-fast: false | |
| name: Release (${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }}) | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.image }} | |
| defaults: | |
| run: | |
| working-directory: /home/gap/.gap/pkg/ | |
| env: | |
| HOME: /home/gap | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Move checked out repo to GAP user root dir | |
| run: | | |
| cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ | |
| - name: Download pre-built dependencies | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: deps-${{ matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' && 'stable' || 'master' }} | |
| path: /tmp/ | |
| - name: Extract dependencies | |
| run: | | |
| tar xf /tmp/deps.tar | |
| cp ./CAP_project/dev/ci_gaprc /home/gap/.gap/gaprc | |
| - name: Release package or simulate release | |
| run: | | |
| cd CAP_project | |
| git config --global user.name "Bot" | |
| git config --global user.email "empty" | |
| CUR_SHA=$(git rev-parse --verify HEAD) | |
| git fetch origin gh-pages | |
| git worktree add gh-pages/ gh-pages || (echo "There was an error. Make sure there is a branch named 'gh-pages'. See https://github.com/homalg-project/PackageJanitor#error-there-was-an-error-make-sure-there-is-a-branch-named-gh-pages"; exit 1) | |
| if [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker:latest" ] && [ "$CUR_SHA" = "$(git rev-parse origin/master)" ] && [ $(dirname "$GITHUB_REPOSITORY") = "homalg-project" ]; then \ | |
| git checkout master; \ | |
| TOKEN="${{ secrets.GITHUB_TOKEN }}" SUBSPLIT_PUSH_SECRET="${{ secrets.SUBSPLIT_PUSH_SECRET }}" ./dev/make_dist.sh; \ | |
| else \ | |
| TOKEN="${{ secrets.GITHUB_TOKEN }}" ./dev/simulate_dist.sh; \ | |
| fi |