Skip to content

Commit 249ccac

Browse files
committed
.github/workflows/ci-sage.yml: New
1 parent 4439f12 commit 249ccac

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

.github/workflows/ci-sage.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
## It runs on every pull request and push of a tag 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+
push:
39+
tags:
40+
- '*'
41+
schedule:
42+
# run each Wednesday at 01:00
43+
- cron: '0 1 * * 3'
44+
workflow_dispatch:
45+
# Allow to run manually
46+
47+
env:
48+
# Ubuntu packages to install so that the project's "make dist" can succeed
49+
DIST_PREREQ:
50+
# Name of this project in the Sage distribution
51+
SPKG: python_flint
52+
# Standard setting: Test the current beta release of Sage:
53+
SAGE_REPO: sagemath/sage
54+
SAGE_REF: develop
55+
REMOVE_PATCHES: "*"
56+
57+
jobs:
58+
59+
dist:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Check out ${{ env.SPKG }}
63+
uses: actions/checkout@v4
64+
with:
65+
path: build/pkgs/${{ env.SPKG }}/src
66+
- name: Install prerequisites
67+
run: |
68+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
69+
sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ
70+
if: env.DIST_PREREQ != ''
71+
- uses: actions/setup-python@v5
72+
with:
73+
python-version: '3.10'
74+
- run: pip install build
75+
- name: Run make dist, prepare upstream artifact
76+
run: |
77+
(cd build/pkgs/${{ env.SPKG }}/src && python -m build --sdist) \
78+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
79+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=standard" > upstream/update-pkgs.sh \
80+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
81+
&& ls -l upstream/
82+
- uses: actions/upload-artifact@v2
83+
with:
84+
path: upstream
85+
name: upstream
86+
87+
linux:
88+
uses: sagemath/sage/.github/workflows/docker.yml@develop
89+
with:
90+
# Sage distribution packages to build
91+
targets: SAGE_CHECK=no SAGE_CHECK_flint=yes SAGE_CHECK_python_flint=yes python_flint
92+
# Standard setting: Test the current beta release of Sage:
93+
sage_repo: sagemath/sage
94+
sage_ref: develop
95+
upstream_artifact: upstream
96+
# Docker targets (stages) to tag
97+
docker_targets: "with-targets"
98+
# We prefix the image name with the SPKG name ("python_flint_") to avoid the error
99+
# 'Package "sage-docker-..." is already associated with another repository.'
100+
docker_push_repository: ghcr.io/${{ github.repository }}/python_flint_
101+
needs: [dist]
102+
103+
macos:
104+
uses: sagemath/sage/.github/workflows/macos.yml@develop
105+
with:
106+
osversion_xcodeversion_toxenv_tuples: >-
107+
[["latest", "", "homebrew-macos-usrlocal-minimal"],
108+
["latest", "", "homebrew-macos-usrlocal-standard"]]
109+
targets: SAGE_CHECK=no SAGE_CHECK_flint=yes SAGE_CHECK_python_flint=yes python_flint
110+
# Standard setting: Test the current beta release of Sage:
111+
sage_repo: sagemath/sage
112+
sage_ref: develop
113+
upstream_artifact: upstream
114+
needs: [dist]

0 commit comments

Comments
 (0)