From 424ce7579d0c9d3c6baf5cd40f75a7bb724e9ee1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 12 Aug 2023 21:05:16 -0700 Subject: [PATCH 1/4] .github/workflows: Add doctest problem matcher --- .github/workflows/build.yml | 1 + .github/workflows/doctest-problem-matcher.json | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .github/workflows/doctest-problem-matcher.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5242dfc06f9..de5027c0f0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,6 +88,7 @@ jobs: - name: Incremental build id: incremental run: | + echo ::add-matcher::.github/workflows/doctest-problem-matcher.json # Now re-bootstrap and build. The build is incremental because we were careful with the timestamps. ./bootstrap && make build working-directory: ./worktree-image diff --git a/.github/workflows/doctest-problem-matcher.json b/.github/workflows/doctest-problem-matcher.json new file mode 100644 index 00000000000..35bd4731d2d --- /dev/null +++ b/.github/workflows/doctest-problem-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "doctest-failure", + "severity": "error", + "pattern": [ + { + "regexp": "^(\\[(\\S*)-[0-9.a-z]\\] )?File \"(\\S*)\", line ([0-9]*), in (\\S*)\\s*$(\\[(\\S*)-[0-9.a-z]\\] )?^(Failed example):", + "code": 2, + "file": 3, + "line": 4, + "message": 7, + } + ] + } + ] +} From 4f697762d6b72ce545c63f16949a5c5e1e372f2e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 25 Oct 2023 20:43:15 -0700 Subject: [PATCH 2/4] .github/workflows/doctest-problem-matcher.json: Add matcher for doctest (style) warnings --- .github/workflows/doctest-problem-matcher.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/doctest-problem-matcher.json b/.github/workflows/doctest-problem-matcher.json index 35bd4731d2d..87020846d1b 100644 --- a/.github/workflows/doctest-problem-matcher.json +++ b/.github/workflows/doctest-problem-matcher.json @@ -12,6 +12,19 @@ "message": 7, } ] + }, + { + "owner": "doctest-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^(\\[(\\S*)-[0-9.a-z]\\] )?File \"(\\S*)\", line ([0-9]*), in (\\S*)\\s*$(\\[(\\S*)-[0-9.a-z]\\] )?^(Warning):", + "code": 2, + "file": 3, + "line": 4, + "message": 7, + } + ] } ] } From bca39900fbcda83498f9839a202fd0ffd8edfb21 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 25 Oct 2023 21:31:52 -0700 Subject: [PATCH 3/4] TMP: Disable tests --- .github/workflows/build.yml | 68 +-------------------- .github/workflows/ci-conda.yml | 105 --------------------------------- 2 files changed, 1 insertion(+), 172 deletions(-) delete mode 100644 .github/workflows/ci-conda.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de5027c0f0f..e6151668790 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,30 +96,6 @@ jobs: MAKE: make -j2 --output-sync=recurse SAGE_NUM_THREADS: 2 - - name: Build modularized distributions - if: always() && steps.worktree.outcome == 'success' - run: make V=0 tox && make SAGE_CHECK=no pypi-wheels - working-directory: ./worktree-image - env: - MAKE: make -j2 --output-sync=recurse - SAGE_NUM_THREADS: 2 - - - name: Set up node to install pyright - if: always() && steps.worktree.outcome == 'success' - uses: actions/setup-node@v3 - with: - node-version: '12' - - - name: Install pyright - if: always() && steps.worktree.outcome == 'success' - # Fix to v232 due to bug https://github.com/microsoft/pyright/issues/3239 - run: npm install -g pyright@1.1.232 - - - name: Static code check with pyright - if: always() && steps.worktree.outcome == 'success' - run: pyright - working-directory: ./worktree-image - - name: Clean (fallback to non-incremental) id: clean if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success' @@ -145,51 +121,9 @@ jobs: # Testing - - name: Test changed files (sage -t --new) - if: always() && steps.build.outcome == 'success' - run: | - # We run tests with "sage -t --new"; this only tests the uncommitted changes. - ./sage -t --new -p2 - working-directory: ./worktree-image - env: - MAKE: make -j2 --output-sync=recurse - SAGE_NUM_THREADS: 2 - - - name: Test modularized distributions - if: always() && steps.build.outcome == 'success' - run: make V=0 tox && make pypi-wheels-check - working-directory: ./worktree-image - env: - MAKE: make -j2 --output-sync=recurse - SAGE_NUM_THREADS: 2 - - - name: Pytest - if: contains(github.ref, 'pytest') - run: | - ../sage -python -m pip install coverage pytest-xdist - ../sage -python -m coverage run -m pytest -c tox.ini --doctest-modules || true - working-directory: ./worktree-image/src - env: - # Increase the length of the lines in the "short summary" - COLUMNS: 120 - - name: Test all files (sage -t --all --long) if: always() && steps.build.outcome == 'success' run: | ../sage -python -m pip install coverage - ../sage -python -m coverage run ./bin/sage-runtests --all --long -p2 --random-seed=286735480429121101562228604801325644303 + ../sage -python -m coverage run ./bin/sage-runtests sage/combinat -p3 --random-seed=286735480429121101562228604801325644303 working-directory: ./worktree-image/src - - - name: Prepare coverage results - if: always() && steps.build.outcome == 'success' - run: | - ./venv/bin/python3 -m coverage combine src/.coverage/ - ./venv/bin/python3 -m coverage xml - find . -name *coverage* - working-directory: ./worktree-image - - - name: Upload coverage to codecov - if: always() && steps.build.outcome == 'success' - uses: codecov/codecov-action@v3 - with: - files: ./worktree-image/coverage.xml diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml deleted file mode 100644 index 2240c224a52..00000000000 --- a/.github/workflows/ci-conda.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Build & Test using Conda - -on: - push: - tags: - - '*' - branches: - - 'public/build/**-runci' - pull_request: - workflow_dispatch: - # Allow to run manually - -concurrency: - # Cancel previous runs of this workflow for the same branch - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - name: Conda - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: ${{ github.event_name == 'pull_request' }} - max-parallel: ${{ github.event_name == 'pull_request' && 2 || 6 }} - matrix: - os: [ubuntu-latest, macos-latest] - python: ['3.9', '3.10', '3.11'] - # Optional environment is disabled for now as its not yet working - # environment: [environment, environment-optional] - conda-env: [environment] - - steps: - - uses: actions/checkout@v4 - - - name: Merge CI fixes from sagemath/sage - run: | - .ci/merge-fixes.sh - env: - GH_TOKEN: ${{ github.token }} - - - name: Create conda environment files - run: ./bootstrap-conda - - - name: Cache conda packages - uses: actions/cache@v3 - with: - path: ~/conda_pkgs_dir - key: - ${{ runner.os }}-conda-${{ hashFiles('src/environment-3.11.yml') }} - - - name: Setup Conda environment - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.python }} - miniforge-version: latest - use-mamba: true - channels: conda-forge - channel-priority: true - activate-environment: sage - environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}.yml - - - name: Print Conda environment - shell: bash -l {0} - run: | - conda info - conda list - - - name: Configure - shell: bash -l {0} - continue-on-error: true - run: | - ./bootstrap - echo "::add-matcher::.github/workflows/configure-systempackage-problem-matcher.json" - ./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX --enable-system-site-packages $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt --exclude rpy2); do echo --with-system-$pkg=force; done) - echo "::remove-matcher owner=configure-system-package-warning::" - echo "::remove-matcher owner=configure-system-package-error::" - - - name: Build - shell: bash -l {0} - run: | - # Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda. - pip install --no-build-isolation --no-deps -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup - pip install --no-build-isolation --no-deps --config-settings editable_mode=compat -v -v -e ./src - env: - SAGE_NUM_THREADS: 2 - - - name: Verify dependencies - if: success() || failure() - shell: bash -l {0} - run: pip check - - - name: Test - if: success() || failure() - shell: bash -l {0} - run: ./sage -t --all -p0 - - - name: Print logs - if: always() - run: | - for file in $(find . -type f -name "*.log"); do - echo "::group::$file" - cat "$file" - echo "::endgroup::" - done From 479dae245ecfb46d8b2d3cc4cb0df59ef0da5785 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 25 Oct 2023 22:20:27 -0700 Subject: [PATCH 4/4] WIP --- .github/workflows/build.yml | 2 +- .github/workflows/doctest-problem-matcher.json | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6151668790..d4c80b164b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,5 +125,5 @@ jobs: if: always() && steps.build.outcome == 'success' run: | ../sage -python -m pip install coverage - ../sage -python -m coverage run ./bin/sage-runtests sage/combinat -p3 --random-seed=286735480429121101562228604801325644303 + ../sage -python -m coverage run ./bin/sage-runtests -p4 --random-seed=286735480429121101562228604801325644303 sage/combinat working-directory: ./worktree-image/src diff --git a/.github/workflows/doctest-problem-matcher.json b/.github/workflows/doctest-problem-matcher.json index 87020846d1b..088c736b1a4 100644 --- a/.github/workflows/doctest-problem-matcher.json +++ b/.github/workflows/doctest-problem-matcher.json @@ -18,11 +18,14 @@ "severity": "warning", "pattern": [ { - "regexp": "^(\\[(\\S*)-[0-9.a-z]\\] )?File \"(\\S*)\", line ([0-9]*), in (\\S*)\\s*$(\\[(\\S*)-[0-9.a-z]\\] )?^(Warning):", + "regexp": "^(\\[(\\S*)-[0-9.a-z]\\] )?File \"(\\S*)\", line ([0-9]*), in (\\S*)", "code": 2, "file": 3, "line": 4, - "message": 7, + }, + { + "regexp": "^(\\[(\\S*)-[0-9.a-z]\\] )?(Warning): (.*)", + "message": 4, } ] }