diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b1a3b8..9b73933 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,11 @@ on: tags: - '*' +concurrency: + # Cancel previous runs of this workflow for the same branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ${{ matrix.os }} @@ -21,9 +26,9 @@ jobs: PARI_VERSION: ${{ matrix.pari-version }} steps: - name: Set up the repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install pari @@ -35,3 +40,86 @@ jobs: make check pip install sphinx (cd docs && make html) + + dist: + runs-on: ubuntu-latest + steps: + - name: Check out ${{ env.SPKG }} + uses: actions/checkout@v4 + with: + path: build/pkgs/${{ env.SPKG }}/src + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + - name: Install prerequisites + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ + python3 -m pip install build + - name: Run make dist, prepare upstream artifact + run: | + (cd build/pkgs/${{ env.SPKG }}/src && python3 -m build --sdist) \ + && mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \ + && echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \ + && if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \ + && ls -l upstream/ + - uses: actions/upload-artifact@v3 + with: + path: upstream + name: upstream + + linux-sage: + uses: sagemath/sage/.github/workflows/docker.yml@develop + with: + targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="cypari" cypari + targets_optional: build/make/Makefile + sage_repo: sagemath/sage + sage_ref: develop + upstream_artifact: upstream + # We prefix the image name with the SPKG name ("cypari2-") to avoid the error + # 'Package "sage-docker-..." is already associated with another repository.' + docker_push_repository: ghcr.io/${{ github.repository }}/cypari2- + needs: [dist] + + linux-sage-incremental: + uses: sagemath/sage/.github/workflows/docker.yml@develop + 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_pre: build/make/Makefile + targets: "cypari-uninstall build doc-html ptest" + targets_optional: build/make/Makefile + sage_repo: sagemath/sage + sage_ref: develop + upstream_artifact: upstream + # We prefix the image name with the SPKG name ("cypari2-") to avoid the error + # 'Package "sage-docker-..." is already associated with another repository.' + docker_push_repository: ghcr.io/${{ github.repository }}/cypari2- + needs: [linux-sage] + + macos-sage: + uses: sagemath/sage/.github/workflows/macos.yml@develop + with: + osversion_xcodeversion_toxenv_tuples: >- + [["latest", "", "homebrew-macos-usrlocal-minimal"], + ["latest", "", "homebrew-macos-usrlocal-standard"], + ["13", "xcode_15.0", "homebrew-macos-usrlocal-standard"], + ["latest", "", "conda-forge-macos-standard"]] + targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="cypari" cypari + # Standard setting: Test the current beta release of Sage + sage_repo: sagemath/sage + sage_ref: develop + upstream_artifact: upstream + needs: [dist] + +env: + # Ubuntu packages to install so that the project's "setup.py sdist" can succeed + DIST_PREREQ: libpari-dev pari-doc + # Name of this project in the Sage distribution + SPKG: cypari + # Remove all downstream patches + REMOVE_PATCHES: "*" diff --git a/MANIFEST.in b/MANIFEST.in index c836145..4d02d76 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include LICENSE README.rst VERSION +include Makefile global-include *.py *.pyx *.pxd *.pxi recursive-exclude cypari2 auto_*