Skip to content

Commit 5c1d165

Browse files
committed
Merge branches 'ci-sage' and 'ci-passagemath-macaulay2' into passagemath
3 parents ce91497 + 675c248 + c82dc41 commit 5c1d165

File tree

2 files changed

+215
-0
lines changed

2 files changed

+215
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Test integration with passagemath-macaulay2
2+
##
3+
## This GitHub Actions workflow uses the portability testing framework
4+
## of passagemath (https://github.com/passagemath).
5+
##
6+
## - Documentation: https://doc.sagemath.org/html/en/developer/portability_testing.html
7+
##
8+
## - Deployment of ci-sage.yml in upstream projects is tracked at
9+
## https://github.com/passagemath/passagemath/issues/704
10+
##
11+
## - Contact: @passagemath/ci team on GitHub
12+
##
13+
## This GitHub Actions workflow provides:
14+
##
15+
## - continuous integration, by building and testing other software
16+
## that depends on this project.
17+
##
18+
## It runs on every push of a tag to the GitHub repository
19+
## and can also be invoked manually ("workflow_dispatch").
20+
##
21+
## The testing can be monitored in the "Actions" tab of the GitHub repository.
22+
##
23+
## After all jobs have finished (or are canceled) and a short delay,
24+
## tar files of all logs are made available as "build artifacts".
25+
##
26+
## The workflow consists of two jobs:
27+
##
28+
## - First, it builds a source distribution of the project
29+
## and generates a script "update-pkgs.sh". It uploads them
30+
## as a build artifact named upstream.
31+
##
32+
## - Second, it checks out a copy of the SageMath source tree.
33+
## It downloads the upstream artifact and replaces the project's
34+
## package in the SageMath distribution by the newly packaged one
35+
## from the upstream artifact, by running the script "update-pkgs.sh".
36+
## Then it builds a small portion of the Sage distribution.
37+
##
38+
## Many copies of the second step are run in parallel for each of the tested
39+
## systems/configurations.
40+
41+
on:
42+
push:
43+
tags:
44+
- '*'
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's "make dist" can succeed
54+
DIST_PREREQ: git
55+
# Name of this project in the Sage distribution
56+
SPKG: macaulay2
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+
73+
- name: Run make dist, prepare upstream artifact
74+
run: |
75+
(cd build/pkgs/${{ env.SPKG }}/src && git archive --format=tar.gz --prefix=${{ env.SPKG }}-git/ HEAD > ${{ env.SPKG }}-git.tar.gz) \
76+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
77+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=optional" > upstream/update-pkgs.sh \
78+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
79+
&& ls -l upstream/
80+
- uses: actions/upload-artifact@v4
81+
with:
82+
path: upstream
83+
name: upstream
84+
85+
passagemath-macaulay2:
86+
uses: passagemath/passagemath/.github/workflows/docker.yml@main
87+
with:
88+
# singular is not suitable, omit
89+
extra_sage_packages: gdbm git libxml2 gfortran cmake python3 openblas zlib readline sqlite libpng bzip2 liblzma libffi openssl 4ti2 fflas_ffpack boost_cropped cddlib givaro glpk gmp mpc mpfi mpfr ncurses ntl readline lrslib normaliz topcom gfan frobby nauty libnauty flint onetbb googletest mpsolve msolve eigen gc ninja_build curl gsl libatomic_ops tox libgd m4ri m4rie iml
90+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="sagemath_macaulay2" sagemath_macaulay2
91+
# Standard setting: Test the current HEAD of passagemath:
92+
sage_repo: passagemath/passagemath
93+
sage_ref: main
94+
upstream_artifact: upstream
95+
# Build incrementally from published Docker image
96+
free_disk_space: true
97+
docker_targets: "with-targets"
98+
tox_system_factors: >-
99+
["ubuntu-noble-macaulay2_daily"]
100+
tox_packages_factors: >-
101+
["minimal"]
102+
# avoid clash with linux job for the same platform
103+
logs_artifact: false
104+
needs: [dist]

.github/workflows/ci-sage.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Run Sage CI
2+
##
3+
## This GitHub Actions workflow uses the portability testing framework
4+
## of passagemath (https://github.com/passagemath).
5+
##
6+
## - Documentation: https://doc.sagemath.org/html/en/developer/portability_testing.html
7+
##
8+
## - Deployment of ci-sage.yml in upstream projects is tracked at
9+
## https://github.com/passagemath/passagemath/issues/704
10+
##
11+
## - Contact: @passagemath/ci team on GitHub
12+
##
13+
## This GitHub Actions workflow provides:
14+
##
15+
## - portability testing, by building and testing this project on many platforms
16+
## (Linux variants and macOS), each with two configurations (installed packages),
17+
##
18+
## - continuous integration, by building and testing other software
19+
## that depends on this project.
20+
##
21+
## It runs on every push of a tag to the GitHub repository
22+
## and can also be invoked manually ("workflow_dispatch").
23+
##
24+
## The testing can be monitored in the "Actions" tab of the GitHub repository.
25+
##
26+
## After all jobs have finished (or are canceled) and a short delay,
27+
## tar files of all logs are made available as "build artifacts".
28+
##
29+
## The workflow consists of two jobs:
30+
##
31+
## - First, it builds a source distribution of the project
32+
## and generates a script "update-pkgs.sh". It uploads them
33+
## as a build artifact named upstream.
34+
##
35+
## - Second, it checks out a copy of the SageMath source tree.
36+
## It downloads the upstream artifact and replaces the project's
37+
## package in the SageMath distribution by the newly packaged one
38+
## from the upstream artifact, by running the script "update-pkgs.sh".
39+
## Then it builds a small portion of the Sage distribution.
40+
##
41+
## Many copies of the second step are run in parallel for each of the tested
42+
## systems/configurations.
43+
44+
on:
45+
push:
46+
tags:
47+
- '*'
48+
workflow_dispatch:
49+
# Allow to run manually
50+
51+
concurrency:
52+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
53+
cancel-in-progress: true
54+
55+
env:
56+
# Ubuntu packages to install so that the project's "make dist" can succeed
57+
DIST_PREREQ: git
58+
# Name of this project in the Sage distribution
59+
SPKG: macaulay2
60+
REMOVE_PATCHES: "*"
61+
62+
jobs:
63+
64+
dist:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Check out ${{ env.SPKG }}
68+
uses: actions/checkout@v4
69+
with:
70+
path: build/pkgs/${{ env.SPKG }}/src
71+
- name: Install prerequisites
72+
run: |
73+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
74+
sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ
75+
76+
- name: Run make dist, prepare upstream artifact
77+
run: |
78+
(cd build/pkgs/${{ env.SPKG }}/src && git archive --format=tar.gz --prefix=${{ env.SPKG }}-git/ HEAD > ${{ env.SPKG }}-git.tar.gz) \
79+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
80+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=optional" > upstream/update-pkgs.sh \
81+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
82+
&& ls -l upstream/
83+
- uses: actions/upload-artifact@v4
84+
with:
85+
path: upstream
86+
name: upstream
87+
88+
linux:
89+
uses: passagemath/passagemath/.github/workflows/docker.yml@main
90+
with:
91+
extra_sage_packages: gdbm git libxml2 gfortran cmake python3 openblas zlib readline sqlite libpng bzip2 liblzma libffi openssl
92+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="macaulay2" macaulay2
93+
# Standard setting: Test the current HEAD of passagemath:
94+
sage_repo: passagemath/passagemath
95+
sage_ref: main
96+
upstream_artifact: upstream
97+
# We prefix the image name with the SPKG name ("macaulay2-") to avoid the error
98+
# 'Package "sage-docker-..." is already associated with another repository.'
99+
docker_push_repository: ghcr.io/${{ github.repository }}/macaulay2-
100+
needs: [dist]
101+
102+
macos:
103+
uses: passagemath/passagemath/.github/workflows/macos.yml@main
104+
with:
105+
extra_sage_packages: gdbm git libxml2 gfortran cmake python3 openblas zlib readline sqlite libpng bzip2 liblzma libffi openssl
106+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="macaulay2" macaulay2
107+
# Standard setting: Test the current HEAD of passagemath:
108+
sage_repo: passagemath/passagemath
109+
sage_ref: main
110+
upstream_artifact: upstream
111+
needs: [dist]

0 commit comments

Comments
 (0)