Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/workflows/main.yml: Add portability/integration testing with Sage #140

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 90 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,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: "*"
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include LICENSE README.rst VERSION
include Makefile
global-include *.py *.pyx *.pxd *.pxi

recursive-exclude cypari2 auto_*
Expand Down
Loading