|
| 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) |
| 7 | +## |
| 8 | +## - continuous integration, by building and testing other software |
| 9 | +## that depends on this project. |
| 10 | +## |
| 11 | +## It runs on every push to the GitHub repository. |
| 12 | +## |
| 13 | +## The testing can be monitored in the "Actions" tab of the GitHub repository. |
| 14 | +## |
| 15 | +## After all jobs have finished (or are canceled) and a short delay, |
| 16 | +## tar files of all logs are made available as "build artifacts". |
| 17 | +## |
| 18 | +## This GitHub Actions workflow uses the portability testing framework |
| 19 | +## of SageMath (https://www.sagemath.org/). For more information, see |
| 20 | +## https://doc.sagemath.org/html/en/developer/portability_testing.html |
| 21 | + |
| 22 | +## The workflow consists of two jobs: |
| 23 | +## |
| 24 | +## - First, it builds a source distribution of the project |
| 25 | +## and generates a script "update-pkgs.sh". It uploads them |
| 26 | +## as a build artifact named upstream. |
| 27 | +## |
| 28 | +## - Second, it checks out a copy of the SageMath source tree. |
| 29 | +## It downloads the upstream artifact and replaces the project's |
| 30 | +## package in the SageMath distribution by the newly packaged one |
| 31 | +## from the upstream artifact, by running the script "update-pkgs.sh". |
| 32 | +## Then it builds a small portion of the Sage distribution. |
| 33 | +## |
| 34 | +## Many copies of the second step are run in parallel for each of the tested |
| 35 | +## systems/configurations. |
| 36 | + |
| 37 | +on: |
| 38 | + pull_request: |
| 39 | + branches: |
| 40 | + - master |
| 41 | + push: |
| 42 | + tags: |
| 43 | + branches: |
| 44 | + - master |
| 45 | + workflow_dispatch: |
| 46 | + # Allow to run manually |
| 47 | + |
| 48 | +concurrency: |
| 49 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 50 | + cancel-in-progress: true |
| 51 | + |
| 52 | +env: |
| 53 | + # Ubuntu packages to install so that the project can build an sdist |
| 54 | + DIST_PREREQ: libgmp-dev libflint-dev libmpfr-dev libntl-dev |
| 55 | + # Name of this project in the Sage distribution |
| 56 | + SPKG: msolve |
| 57 | + REMOVE_PATCHES: |
| 58 | + |
| 59 | +jobs: |
| 60 | + |
| 61 | + dist: |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: Check out ${{ env.SPKG }} |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + path: build/pkgs/${{ env.SPKG }}/src |
| 68 | + - name: Install prerequisites |
| 69 | + run: | |
| 70 | + sudo DEBIAN_FRONTEND=noninteractive apt-get update |
| 71 | + sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ |
| 72 | + - name: Run make dist, prepare upstream artifact |
| 73 | + run: | |
| 74 | + (cd build/pkgs/${{ env.SPKG }}/src && ./autogen.sh && ./configure && make dist) \ |
| 75 | + && mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \ |
| 76 | + && echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \ |
| 77 | + && if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \ |
| 78 | + && ls -l upstream/ |
| 79 | + - uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + path: upstream |
| 82 | + name: upstream |
| 83 | + |
| 84 | + mingw: |
| 85 | + uses: passagemath/passagemath/.github/workflows/mingw.yml@main |
| 86 | + with: |
| 87 | + # Extra system packages to install. See available packages at |
| 88 | + # https://github.com/passagemath/passagemath/tree/main/build/pkgs |
| 89 | + extra_sage_packages: "patch gmp mpfr flint" |
| 90 | + # Sage distribution packages to build |
| 91 | + targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="msolve" msolve |
| 92 | + # Standard setting: Test the current main branch |
| 93 | + sage_repo: passagemath/passagemath |
| 94 | + sage_ref: main |
| 95 | + upstream_artifact: upstream |
| 96 | + needs: [dist] |
0 commit comments