|
| 1 | +name: Run Sage CI |
| 2 | + |
| 3 | +## This GitHub Actions workflow provides: |
| 4 | +## |
| 5 | +## - portability testing, by building and testing this project on many platforms |
| 6 | +## (Linux variants and Cygwin), each with two configurations (installed packages), |
| 7 | +## |
| 8 | +## - continuous integration, by building and testing other software |
| 9 | +## that depends on this project. |
| 10 | +## |
| 11 | +## The testing can be monitored in the "Actions" tab of the GitHub repository. |
| 12 | +## |
| 13 | +## After all jobs have finished (or are canceled) and a short delay, |
| 14 | +## tar files of all logs are made available as "build artifacts". |
| 15 | +## |
| 16 | +## This GitHub Actions workflow uses the portability testing framework |
| 17 | +## of SageMath (https://www.sagemath.org/). For more information, see |
| 18 | +## https://doc.sagemath.org/html/en/developer/portability_testing.html |
| 19 | + |
| 20 | +## The workflow consists of two jobs: |
| 21 | +## |
| 22 | +## - First, it builds a source distribution of the project |
| 23 | +## and generates a script "update-pkgs.sh". It uploads them |
| 24 | +## as a build artifact named upstream. |
| 25 | +## |
| 26 | +## - Second, it checks out a copy of the SageMath source tree. |
| 27 | +## It downloads the upstream artifact and replaces the project's |
| 28 | +## package in the SageMath distribution by the newly packaged one |
| 29 | +## from the upstream artifact, by running the script "update-pkgs.sh". |
| 30 | +## Then it builds a small portion of the Sage distribution. |
| 31 | +## |
| 32 | +## Many copies of the second step are run in parallel for each of the tested |
| 33 | +## systems/configurations. |
| 34 | + |
| 35 | +on: |
| 36 | + push: |
| 37 | + tags: |
| 38 | + - '*' |
| 39 | + schedule: |
| 40 | + # run each Wednesday at 01:00 |
| 41 | + - cron: '0 1 * * 3' |
| 42 | + workflow_dispatch: |
| 43 | + # Allow to run manually |
| 44 | + |
| 45 | +env: |
| 46 | + # Ubuntu packages to install so that the project's "make dist" can succeed |
| 47 | + DIST_PREREQ: |
| 48 | + # Name of this project in the Sage distribution |
| 49 | + SPKG: python_flint |
| 50 | + # Standard setting: Test the current beta release of Sage: |
| 51 | + REMOVE_PATCHES: "*" |
| 52 | + |
| 53 | +jobs: |
| 54 | + |
| 55 | + dist: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: Check out ${{ env.SPKG }} |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + path: build/pkgs/${{ env.SPKG }}/src |
| 62 | + - name: Install prerequisites |
| 63 | + run: | |
| 64 | + sudo DEBIAN_FRONTEND=noninteractive apt-get update |
| 65 | + sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ |
| 66 | + if: env.DIST_PREREQ != '' |
| 67 | + - uses: actions/setup-python@v5 |
| 68 | + with: |
| 69 | + python-version: '3.10' |
| 70 | + - run: pip install build |
| 71 | + - name: Run make dist, prepare upstream artifact |
| 72 | + run: | |
| 73 | + (cd build/pkgs/${{ env.SPKG }}/src && python -m build --sdist) \ |
| 74 | + && mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \ |
| 75 | + && echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \ |
| 76 | + && if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \ |
| 77 | + && ls -l upstream/ |
| 78 | + - uses: actions/upload-artifact@v2 |
| 79 | + with: |
| 80 | + path: upstream |
| 81 | + name: upstream |
| 82 | + |
| 83 | + linux: |
| 84 | + uses: sagemath/sage/.github/workflows/docker.yml@develop |
| 85 | + with: |
| 86 | + # Sage distribution packages to build |
| 87 | + targets: SAGE_CHECK=no SAGE_CHECK_flint=warn SAGE_CHECK_python_flint=yes python_flint |
| 88 | + # Standard setting: Test the current beta release of Sage: |
| 89 | + sage_repo: sagemath/sage |
| 90 | + sage_ref: refs/pull/37224/head |
| 91 | + #sage_ref: develop |
| 92 | + upstream_artifact: upstream |
| 93 | + # Docker targets (stages) to tag |
| 94 | + docker_targets: "with-targets" |
| 95 | + # We prefix the image name with the SPKG name ("python_flint_") to avoid the error |
| 96 | + # 'Package "sage-docker-..." is already associated with another repository.' |
| 97 | + docker_push_repository: ghcr.io/${{ github.repository }}/python_flint_ |
| 98 | + needs: [dist] |
| 99 | + |
| 100 | + macos: |
| 101 | + uses: sagemath/sage/.github/workflows/macos.yml@develop |
| 102 | + with: |
| 103 | + osversion_xcodeversion_toxenv_tuples: >- |
| 104 | + [["latest", "", "homebrew-macos-usrlocal-minimal"], |
| 105 | + ["latest", "", "homebrew-macos-usrlocal-standard"]] |
| 106 | + targets: SAGE_CHECK=no SAGE_CHECK_flint=warn SAGE_CHECK_python_flint=yes python_flint |
| 107 | + # Standard setting: Test the current beta release of Sage: |
| 108 | + sage_repo: sagemath/sage |
| 109 | + sage_ref: refs/pull/37224/head |
| 110 | + #sage_ref: develop |
| 111 | + upstream_artifact: upstream |
| 112 | + needs: [dist] |
0 commit comments