From 627d7a2d8707920f6c1a967ef6a6b22f1db71041 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 19 Jul 2025 17:19:08 +0200 Subject: [PATCH] Replace ci-linux-incremental by ci-linux --- .github/workflows/build.yml | 2 +- .../workflows/{ci-linux.yml => ci-distro.yml} | 24 +++- .github/workflows/ci-linux-incremental.yml | 107 ------------------ src/doc/en/developer/portability_testing.rst | 2 +- 4 files changed, 21 insertions(+), 114 deletions(-) rename .github/workflows/{ci-linux.yml => ci-distro.yml} (71%) delete mode 100644 .github/workflows/ci-linux-incremental.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65f721a0774..a6b7691a817 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ concurrency: # # each build Sage: # -# - incrementally starting from a Docker image that ci-linux.yml +# - incrementally starting from a Docker image that ci-distro.yml # publishes on each development release to ghcr.io, # - orchestrated using a tox-generated Dockerfile, # - using https://github.com/marketplace/actions/build-and-push-docker-images, diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-distro.yml similarity index 71% rename from .github/workflows/ci-linux.yml rename to .github/workflows/ci-distro.yml index 42b1e8c0af8..c7957050fa6 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-distro.yml @@ -1,7 +1,7 @@ -name: CI Linux +name: CI (Distro) -## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with selected environments, -## whenever a tag is pushed. +## This GitHub Actions workflow builds and tests sage with selected environments, +## whenever a tag is pushed or a pull request changes relevant build files. ## ## It builds and checks some sage spkgs as defined in TARGETS. ## @@ -14,9 +14,18 @@ name: CI Linux ## After all jobs have finished (or are canceled) and a short delay, ## tar files of all logs are made available as "build artifacts". -#on: [push, pull_request] - on: + pull_request: + paths: + - '.github/workflows/ci-distro.yml' + - 'build/pkgs/**' + - 'configure.ac' + - '!build/pkgs/sage_conf/**' + - '!build/pkgs/sage_docbuild/**' + - '!build/pkgs/sage_setup/**' + - '!build/pkgs/sage_sws2rst/**' + - '!build/pkgs/sagelib/**' + - '!build/pkgs/sagemath_*/**' push: tags: - '*' @@ -31,6 +40,11 @@ env: permissions: packages: write +concurrency: + # Cancel previous runs of this workflow for the same branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: minimal: if: ${{ success() || failure() }} diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml deleted file mode 100644 index 3ab9c57efeb..00000000000 --- a/.github/workflows/ci-linux-incremental.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: CI Linux incremental - -## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with selected environments, -## whenever a GitHub pull request is opened or synchronized in a repository -## where GitHub Actions are enabled. -## -## It builds and checks some sage spkgs as defined in TARGETS. -## -## A job succeeds if there is no error. -## -## The build is run with "make V=0", so the build logs of individual packages are suppressed. -## -## At the end, all package build logs that contain an error are printed out. -## -## After all jobs have finished (or are canceled) and a short delay, -## tar files of all logs are made available as "build artifacts". - -on: - pull_request: - paths: - - '.github/workflows/ci-linux-incremental.yml' - - 'build/pkgs/**' - - 'configure.ac' - - '!build/pkgs/sage_conf/**' - - '!build/pkgs/sage_docbuild/**' - - '!build/pkgs/sage_setup/**' - - '!build/pkgs/sage_sws2rst/**' - - '!build/pkgs/sagelib/**' - - '!build/pkgs/sagemath_*/**' - workflow_dispatch: - -concurrency: - # Cancel previous runs of this workflow for the same branch - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - packages: write - -jobs: - - changed_files: - runs-on: ubuntu-latest - name: List changed packages - outputs: - build_targets: ${{ steps.build-targets.outputs.build_targets }} - steps: - - uses: actions/checkout@v4 - - name: Get all packages that have changed - id: changed-files - uses: tj-actions/changed-files@v46 - with: - files_yaml: | - configures: - - 'build/pkgs/*/spkg-configure.m4' - pkgs: - - 'build/pkgs/**' - - 'pkgs/**' - - name: Determine targets to build - id: build-targets - run: | - uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) - build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) - if [ -n "$uninstall_targets" ]; then - echo "build_targets=$uninstall_targets reconfigure $build_targets" >> $GITHUB_OUTPUT - else - echo "build_targets=$build_targets" >> $GITHUB_OUTPUT - fi - cat $GITHUB_OUTPUT - - uses: actions/checkout@v4 - with: - ref: ${{ github.base_ref }} - path: worktree-base - if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - - name: Compute metrics - run: | - export PATH=build/bin:$PATH - if [ -d worktree-base ]; then - (echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt - (echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt - diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true - else - sage-package metrics :all: - fi - - test: - needs: [changed_files] - uses: ./.github/workflows/docker.yml - with: - # Build incrementally from published Docker image - incremental: true - free_disk_space: true - from_docker_repository: ghcr.io/sagemath/sage/ - from_docker_target: "with-targets" - from_docker_tag: "dev" - docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.build_targets}} ci-build-with-fallback ptest-nodoc" - tox_system_factors: >- - ["ubuntu-focal", - "ubuntu-jammy", - "debian-bullseye", - "debian-bookworm", - "fedora-41",] - tox_packages_factors: >- - ["standard"] - docker_push_repository: ghcr.io/${{ github.repository }}/ - max_parallel: 8 diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 2a8aa1059f7..f1c3bfe5cca 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1003,7 +1003,7 @@ on every release tag. This is defined in the files -- :sage_root:`.github/workflows/ci-linux.yml` +- :sage_root:`.github/workflows/ci-distro.yml` (which calls :sage_root:`.github/workflows/docker.yml`) and - :sage_root:`.github/workflows/ci-macos.yml`