Skip to content

Commit fab98f1

Browse files
author
Matthias Koeppe
committed
.github/workflows/ci-sage.yml: New
1 parent 22b6ba0 commit fab98f1

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

.github/workflows/ci-sage.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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, macOS)
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+
pull_request:
39+
push:
40+
tags:
41+
- '*'
42+
workflow_dispatch:
43+
# Allow to run manually
44+
45+
concurrency:
46+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
47+
cancel-in-progress: true
48+
49+
env:
50+
# Ubuntu packages to install so that the project's "make dist" can succeed
51+
DIST_PREREQ: python3-pip
52+
# Name of this project in the Sage distribution
53+
SPKG: sage_numerical_backends_coin
54+
REMOVE_PATCHES: "*"
55+
56+
jobs:
57+
58+
dist:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Check out ${{ env.SPKG }}
62+
uses: actions/checkout@v3
63+
with:
64+
path: build/pkgs/${{ env.SPKG }}/src
65+
- name: Install prerequisites
66+
run: |
67+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
68+
sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ
69+
python3 -m pip install --user build
70+
- name: Run make dist, prepare upstream artifact
71+
run: |
72+
(cd build/pkgs/${{ env.SPKG }}/src && python3 -m build --sdist) \
73+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
74+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=optional" > upstream/update-pkgs.sh \
75+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
76+
&& ls -l upstream/
77+
- uses: actions/upload-artifact@v3
78+
with:
79+
path: upstream
80+
name: upstream
81+
82+
linux:
83+
uses: sagemath/sage/.github/workflows/docker.yml@develop
84+
with:
85+
# Sage distribution packages to build
86+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES=sage_numerical_backends_coin sagelib sage_numerical_backends_coin
87+
# Standard setting: Test the current beta release of Sage:
88+
sage_repo: sagemath/sage
89+
sage_ref: develop
90+
upstream_artifact: upstream
91+
# Docker targets (stages) to tag
92+
docker_targets: "with-targets"
93+
docker_push_repository: ghcr.io/${{ github.repository }}/sage-numerical-backends-coin-
94+
needs: [dist]
95+
96+
macos:
97+
uses: sagemath/sage/.github/workflows/macos.yml@develop
98+
with:
99+
# Sage distribution packages to build
100+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES=sage_numerical_backends_coin sagelib sage_numerical_backends_coin
101+
# Standard setting: Test the current beta release of Sage:
102+
sage_repo: sagemath/sage
103+
sage_ref: develop
104+
upstream_artifact: upstream
105+
needs: [dist]

0 commit comments

Comments
 (0)