Skip to content

Commit 5f6ac21

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

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

.github/workflows/ci-sage.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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-build
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+
- name: Run make dist, prepare upstream artifact
70+
run: |
71+
(cd build/pkgs/${{ env.SPKG }}/src && python3 -m build) \
72+
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
73+
&& echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=optional" > upstream/update-pkgs.sh \
74+
&& if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \
75+
&& ls -l upstream/
76+
- uses: actions/upload-artifact@v3
77+
with:
78+
path: upstream
79+
name: upstream
80+
81+
linux:
82+
uses: sagemath/sage/.github/workflows/docker.yml@develop
83+
with:
84+
# Sage distribution packages to build
85+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES=sage_numerical_backends_coin sage_numerical_backends_coin
86+
# Standard setting: Test the current beta release of Sage:
87+
sage_repo: sagemath/sage
88+
sage_ref: develop
89+
upstream_artifact: upstream
90+
# Docker targets (stages) to tag
91+
docker_targets: "with-targets"
92+
docker_push_repository: ghcr.io/${{ github.repository }}/sage-numerical-backends-coin-
93+
needs: [dist]
94+
95+
macos:
96+
uses: sagemath/sage/.github/workflows/macos.yml@develop
97+
with:
98+
# Sage distribution packages to build
99+
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES=sage_numerical_backends_coin sage_numerical_backends_coin
100+
# Standard setting: Test the current beta release of Sage:
101+
sage_repo: sagemath/sage
102+
sage_ref: develop
103+
upstream_artifact: upstream
104+
needs: [dist]

0 commit comments

Comments
 (0)