Skip to content

Commit

Permalink
.github/workflows/main.yml: Add portability/integration testing with …
Browse files Browse the repository at this point in the history
…Sage
  • Loading branch information
Matthias Koeppe committed Oct 6, 2023
1 parent 7386a9f commit 66a0491
Showing 1 changed file with 91 additions and 2 deletions.
93 changes: 91 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -35,3 +40,87 @@ 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
# Keep the current downstream patches (for Cython 3 support)
#REMOVE_PATCHES: "*"
REMOVE_PATCHES:

0 comments on commit 66a0491

Please sign in to comment.