diff --git a/.github/workflows/Codecov.yml b/.github/workflows/Codecov.yml new file mode 100644 index 0000000..0a6156c --- /dev/null +++ b/.github/workflows/Codecov.yml @@ -0,0 +1,51 @@ +name: Codecov + +on: + workflow_run: + workflows: ["Tests"] + types: + - completed + +jobs: + upload: + if: >- + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event != 'schedule' + permissions: + actions: read + contents: read + pull-requests: read + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Download coverage artifacts + uses: actions/download-artifact@v4 + with: + pattern: coverage + path: /tmp/coverage-artifacts + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Restore coverage files + run: | + cp -v /tmp/coverage-artifacts/*.json . 2>/dev/null || true + - name: Resolve PR number on PR events + id: resolve_pr + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER="" + if [ "${{ github.event.workflow_run.event }}" = "pull_request" ]; then + HEAD="${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}" + PR_NUMBER=$(gh api "repos/${{ github.repository }}/pulls?state=all&head=${HEAD}" --jq ".[0].number // empty") + fi + echo "pr_number=${PR_NUMBER}" >> "$GITHUB_OUTPUT" + echo "Resolved PR: ${PR_NUMBER:-(none)}" + - name: Upload to Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} + CODECOV_BRANCH: ${{ github.event.workflow_run.head_branch }} + CODECOV_PR: ${{ steps.resolve_pr.outputs.pr_number }} + run: ./dev/upload_codecov.sh diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 44c4a85..7652eb8 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -37,9 +37,8 @@ jobs: 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@v3 + uses: actions/checkout@v4 with: - # the persisted token interferes with the subsplit token used below persist-credentials: false fetch-depth: 0 - name: Move checked out repo to GAP user root dir @@ -66,10 +65,27 @@ jobs: - name: Test LoopIntegrals run: | make -C LoopIntegrals --trace -j $(nproc) --output-sync ci-test - - name: Release package or simulate release + - name: Process coverage files + if: always() && matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' run: | cd LoopIntegrals 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 + cp LoopIntegrals/coverage*.json /tmp/coverage-collect/ 2>/dev/null || true + - 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 + path: /tmp/coverage-collect/ + if-no-files-found: ignore + retention-days: 1 + - name: Release package or simulate release + run: | + cd LoopIntegrals git config --global user.name "Bot" git config --global user.email "empty" CUR_SHA=$(git rev-parse --verify HEAD) @@ -81,10 +97,3 @@ jobs: else \ TOKEN="${{ secrets.GITHUB_TOKEN }}" ./dev/simulate_dist.sh; \ fi - - name: Upload code coverage - if: github.event_name != 'schedule' && matrix.image == 'ghcr.io/homalg-project/gap-docker:latest' - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: | - cd LoopIntegrals - ./dev/upload_codecov.sh diff --git a/PackageInfo.g b/PackageInfo.g index 375859a..41a6790 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "LoopIntegrals", Subtitle := "Compute master integrals using commutative and noncommutative methods from computational algebraic geometry", -Version := "2025.12-01", +Version := "2026.05-02", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), diff --git a/dev/upload_codecov.sh b/dev/upload_codecov.sh index ff3812c..18d0d66 100755 --- a/dev/upload_codecov.sh +++ b/dev/upload_codecov.sh @@ -28,9 +28,21 @@ else echo -e "\033[0;32mUsing CODECOV_TOKEN from environment variable.\033[0m" fi +# build extra args for commit/branch/PR override (used by workflow_run context) +EXTRA_ARGS="" +if [ -n "$CODECOV_COMMIT_SHA" ]; then + EXTRA_ARGS="$EXTRA_ARGS -C $CODECOV_COMMIT_SHA" +fi +if [ -n "$CODECOV_BRANCH" ]; then + EXTRA_ARGS="$EXTRA_ARGS -B $CODECOV_BRANCH" +fi +if [ -n "$CODECOV_PR" ]; then + EXTRA_ARGS="$EXTRA_ARGS -P $CODECOV_PR" +fi + # execute chmod +x codecov -while ! ./codecov -Z -v -s ../ -t $CODECOV_TOKEN; do +while ! ./codecov -Z -v -s ../ -t $CODECOV_TOKEN $EXTRA_ARGS; do echo "Codecov upload failed, retrying in 60s" sleep 60 done diff --git a/examples/1LoopBox.g b/examples/1LoopBox.g index ca70548..91efc15 100644 --- a/examples/1LoopBox.g +++ b/examples/1LoopBox.g @@ -121,8 +121,9 @@ gen2 := GeneratorsOfScalelessSectors( LD, [ 2, 2, 2, 2 ] ); Display( gen2 ); #! D1*D2*D3^2*D4^2,D1^2*D2*D3*D4^2,D1*D2^2*D3^2*D4,D1^2*D2^2*D3*D4 prel2 := ColumnReversedMatrixOfCoefficientsOfParametricIBPs( LD, 2 ); -#! [ , -#! [ D1_*D3_, D1_*D4_, D2_*D4_, D3_*D4_, D1_, D2_, D3_, D4_, 1, D1, D2 ] ] +#! [ , +#! [ D1_*D2_, D1_*D3_, D2_*D3_, D1_*D4_, D2_*D4_, D3_*D4_, D1_, D2_, D3_, D4_, +#! 1, D1, D2 ] ] dibps := MatrixOfIBPRelationsWithDimensionShift( LD ); #! Display( dibps ); diff --git a/examples/julia/notebooks/1LoopBox.ipynb b/examples/julia/notebooks/1LoopBox.ipynb index 1c963a4..5aa7ee4 100644 --- a/examples/julia/notebooks/1LoopBox.ipynb +++ b/examples/julia/notebooks/1LoopBox.ipynb @@ -10,7 +10,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "CapAndHomalg v\u001b[32m1.6.8\u001b[39m\n", + "CapAndHomalg v\u001b[32m1.6.10\u001b[39m\n", "Imported OSCAR's components GAP and Singular_jll\n", "Type: ?CapAndHomalg for more information\n" ] @@ -955,7 +955,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.12.1" + "version": "1.12.6" } }, "nbformat": 4, diff --git a/examples/julia/notebooks/1LoopBox_using_Ore_algebra.ipynb b/examples/julia/notebooks/1LoopBox_using_Ore_algebra.ipynb index 0f787c8..5d2ee02 100644 --- a/examples/julia/notebooks/1LoopBox_using_Ore_algebra.ipynb +++ b/examples/julia/notebooks/1LoopBox_using_Ore_algebra.ipynb @@ -50,7 +50,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "CapAndHomalg v\u001b[32m1.6.8\u001b[39m\n", + "CapAndHomalg v\u001b[32m1.6.10\u001b[39m\n", "Imported OSCAR's components GAP and Singular_jll\n", "Type: ?CapAndHomalg for more information\n" ] @@ -1340,7 +1340,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.12.1" + "version": "1.12.6" } }, "nbformat": 4, diff --git a/examples/julia/notebooks/1LoopTadpole.ipynb b/examples/julia/notebooks/1LoopTadpole.ipynb index 4925c0e..025da9f 100644 --- a/examples/julia/notebooks/1LoopTadpole.ipynb +++ b/examples/julia/notebooks/1LoopTadpole.ipynb @@ -10,7 +10,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "CapAndHomalg v\u001b[32m1.6.8\u001b[39m\n", + "CapAndHomalg v\u001b[32m1.6.10\u001b[39m\n", "Imported OSCAR's components GAP and Singular_jll\n", "Type: ?CapAndHomalg for more information\n" ] @@ -857,7 +857,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.12.1" + "version": "1.12.6" } }, "nbformat": 4, diff --git a/examples/notebooks/1LoopBox.ipynb b/examples/notebooks/1LoopBox.ipynb index c954159..5a6c032 100644 --- a/examples/notebooks/1LoopBox.ipynb +++ b/examples/notebooks/1LoopBox.ipynb @@ -50,7 +50,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "CapAndHomalg v\u001b[32m1.6.8\u001b[39m\n", + "\r", + "CapAndHomalg v\u001b[32m1.6.10\u001b[39m\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "Imported OSCAR's components GAP and Singular_jll\n", "Type: ?CapAndHomalg for more information\n" ] @@ -1035,7 +1042,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.12.3" + "version": "1.12.6" } }, "nbformat": 4,