1 | name: Run Sage CI for Linux/Cygwin/macOS |
---|
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: [push, pull_request] |
---|
38 | |
---|
39 | on: |
---|
40 | pull_request: |
---|
41 | types: [opened, synchronize] |
---|
42 | push: |
---|
43 | tags: |
---|
44 | - '*' |
---|
45 | workflow_dispatch: |
---|
46 | # Allow to run manually |
---|
47 | |
---|
48 | concurrency: |
---|
49 | # Cancel previous runs of this workflow for the same branch |
---|
50 | group: ${{ github.workflow }}-${{ github.ref }} |
---|
51 | cancel-in-progress: true |
---|
52 | |
---|
53 | env: |
---|
54 | # Ubuntu packages to install so that the project's "make dist" can succeed |
---|
55 | DIST_PREREQ: libcdd-dev |
---|
56 | # Name of this project in the Sage distribution |
---|
57 | SPKG: singular |
---|
58 | # Sage distribution packages to build |
---|
59 | TARGETS_PRE: build/make/Makefile |
---|
60 | TARGETS: SAGE_CHECK=no SAGE_CHECK_PACKAGES=singular singular |
---|
61 | TARGETS_OPTIONAL: SAGE_CHECK=no SAGE_CHECK_pysingular=warn pysingular |
---|
62 | # Need texinfo for building the Singular documentation |
---|
63 | EXTRA_SAGE_PACKAGES: info |
---|
64 | # Standard setting: Test the current beta release of Sage: |
---|
65 | SAGE_REPO: sagemath/sage |
---|
66 | SAGE_REF: develop |
---|
67 | # Temporarily test with the branch from a sage ticket which enables platforms with GCC 12 |
---|
68 | # (this is a no-op after that ticket is merged) |
---|
69 | SAGE_TRAC_GIT: https://github.com/sagemath/sagetrac-mirror.git |
---|
70 | SAGE_TICKET: 33160 |
---|
71 | REMOVE_PATCHES: "*" |
---|
72 | |
---|
73 | jobs: |
---|
74 | |
---|
75 | dist: |
---|
76 | runs-on: ubuntu-latest |
---|
77 | steps: |
---|
78 | - name: Check out ${{ env.SPKG }} |
---|
79 | uses: actions/checkout@v2 |
---|
80 | with: |
---|
81 | path: build/pkgs/${{ env.SPKG }}/src |
---|
82 | - name: Install prerequisites |
---|
83 | run: | |
---|
84 | sudo DEBIAN_FRONTEND=noninteractive apt-get update |
---|
85 | sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ |
---|
86 | - name: Run make dist, prepare upstream artifact |
---|
87 | run: | |
---|
88 | (cd build/pkgs/${{ env.SPKG }}/src && (./autogen.sh && ./configure && make dist) ) \ |
---|
89 | && mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \ |
---|
90 | && echo "sage-package create ${{ env.SPKG }} --version git --tarball ${{ env.SPKG }}-git.tar.gz --type=optional" > upstream/update-pkgs.sh \ |
---|
91 | && if [ -n "${{ env.REMOVE_PATCHES }}" ]; then echo "(cd ../build/pkgs/${{ env.SPKG }}/patches && rm -f ${{ env.REMOVE_PATCHES }}; :)" >> upstream/update-pkgs.sh; fi \ |
---|
92 | && echo 'echo ntl flint readline mpfr cddlib 4ti2 > ../build/pkgs/singular/dependencies' >> upstream/update-pkgs.sh \ |
---|
93 | && ls -l upstream/ |
---|
94 | - uses: actions/upload-artifact@v2 |
---|
95 | with: |
---|
96 | path: upstream |
---|
97 | name: upstream |
---|
98 | |
---|
99 | kanarienvogel: |
---|
100 | # Quick run for 1 platform first; do not run the other platforms when this already fails |
---|
101 | runs-on: ubuntu-latest |
---|
102 | needs: [dist] |
---|
103 | strategy: |
---|
104 | fail-fast: true |
---|
105 | max-parallel: 4 |
---|
106 | matrix: |
---|
107 | tox_system_factor: [ubuntu-focal] |
---|
108 | tox_packages_factor: [standard] |
---|
109 | env: |
---|
110 | # Override so that this runs faster |
---|
111 | TARGETS: SAGE_CHECK=no singular |
---|
112 | TARGETS_OPTIONAL: build/make/Makefile |
---|
113 | # The rest of this is identical to job "docker": |
---|
114 | TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} |
---|
115 | LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} |
---|
116 | DOCKER_TARGETS: configured with-targets with-targets-optional |
---|
117 | steps: |
---|
118 | - name: Check out SageMath |
---|
119 | uses: actions/checkout@v2 |
---|
120 | with: |
---|
121 | repository: ${{ env.SAGE_REPO }} |
---|
122 | ref: ${{ env.SAGE_REF }} |
---|
123 | fetch-depth: 2000 |
---|
124 | if: env.SAGE_REPO != '' |
---|
125 | - name: Check out git-trac-command |
---|
126 | uses: actions/checkout@v2 |
---|
127 | with: |
---|
128 | repository: sagemath/git-trac-command |
---|
129 | path: git-trac-command |
---|
130 | if: env.SAGE_TRAC_GIT != '' |
---|
131 | - name: Check out SageMath from trac.sagemath.org |
---|
132 | shell: bash {0} |
---|
133 | run: | |
---|
134 | git config --global user.email "ci-sage@example.com" |
---|
135 | git config --global user.name "ci-sage workflow" |
---|
136 | if [ ! -d .git ]; then git init; fi; git remote add trac ${{ env.SAGE_TRAC_GIT }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch $SAGE_TICKET; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1 |
---|
137 | if: env.SAGE_TRAC_GIT != '' |
---|
138 | - uses: actions/download-artifact@v2 |
---|
139 | with: |
---|
140 | path: upstream |
---|
141 | name: upstream |
---|
142 | - name: Install test prerequisites |
---|
143 | run: | |
---|
144 | sudo DEBIAN_FRONTEND=noninteractive apt-get update |
---|
145 | sudo DEBIAN_FRONTEND=noninteractive apt-get install tox python3-setuptools |
---|
146 | - name: Update Sage packages from upstream artifact |
---|
147 | run: | |
---|
148 | (export PATH=$(pwd)/build/bin:$PATH; (cd upstream && bash -x update-pkgs.sh) && sed -i.bak '/upstream/d' .dockerignore && echo "/:toolchain:/i ADD upstream upstream" | sed -i.bak -f - build/bin/write-dockerfile.sh && git diff) |
---|
149 | - name: Configure and build Sage distribution within a Docker container |
---|
150 | run: | |
---|
151 | set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;" |
---|
152 | - name: Copy logs from the Docker image or build container |
---|
153 | run: | |
---|
154 | mkdir -p "artifacts/$LOGS_ARTIFACT_NAME" |
---|
155 | cp -r .tox/$TOX_ENV/Dockerfile .tox/$TOX_ENV/log "artifacts/$LOGS_ARTIFACT_NAME" |
---|
156 | if [ -f .tox/$TOX_ENV/Dockertags ]; then CONTAINERS=$(docker create $(tail -1 .tox/$TOX_ENV/Dockertags) /bin/bash || true); fi |
---|
157 | if [ -n "$CONTAINERS" ]; then for CONTAINER in $CONTAINERS; do for ARTIFACT in /sage/logs; do docker cp $CONTAINER:$ARTIFACT artifacts/$LOGS_ARTIFACT_NAME && HAVE_LOG=1; done; if [ -n "$HAVE_LOG" ]; then break; fi; done; fi |
---|
158 | if: always() |
---|
159 | - uses: actions/upload-artifact@v2 |
---|
160 | with: |
---|
161 | path: artifacts |
---|
162 | name: ${{ env.LOGS_ARTIFACT_NAME }} |
---|
163 | if: always() |
---|
164 | - name: Print out logs for immediate inspection |
---|
165 | # and markup the output with GitHub Actions logging commands |
---|
166 | run: | |
---|
167 | .github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME" |
---|
168 | if: always() |
---|
169 | - name: Push Docker images |
---|
170 | run: | |
---|
171 | if [ -f .tox/$TOX_ENV/Dockertags ]; then |
---|
172 | TOKEN="${{ secrets.DOCKER_PKG_GITHUB_TOKEN }}" |
---|
173 | if [ -z "$TOKEN" ]; then |
---|
174 | TOKEN="${{ secrets.GITHUB_TOKEN }}" |
---|
175 | fi |
---|
176 | echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin |
---|
177 | for a in $(cat .tox/$TOX_ENV/Dockertags); do |
---|
178 | FULL_TAG=docker.pkg.github.com/$(echo ${{ github.repository }}|tr 'A-Z' 'a-z')/$a |
---|
179 | docker tag $a $FULL_TAG |
---|
180 | echo Pushing $FULL_TAG |
---|
181 | docker push $FULL_TAG |
---|
182 | done || echo "(Ignoring errors)" |
---|
183 | fi |
---|
184 | if: always() |
---|
185 | |
---|
186 | schwanenfenster: |
---|
187 | env: |
---|
188 | STAGE: i-a |
---|
189 | LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} |
---|
190 | LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} |
---|
191 | MAKE: make -j8 |
---|
192 | SAGE_NUM_THREADS: 3 |
---|
193 | SAGE_CHECK: yes |
---|
194 | SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl" |
---|
195 | CYGWIN: winsymlinks:native |
---|
196 | CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url |
---|
197 | SAGE_FAT_BINARY: yes |
---|
198 | SAGE_LOCAL: /opt/sage-singular-${{ github.sha }} |
---|
199 | |
---|
200 | runs-on: windows-latest |
---|
201 | |
---|
202 | needs: [dist] |
---|
203 | |
---|
204 | strategy: |
---|
205 | fail-fast: false |
---|
206 | matrix: |
---|
207 | pkgs: [minimal, standard] |
---|
208 | steps: |
---|
209 | - run: | |
---|
210 | git config --global core.autocrlf false |
---|
211 | git config --global core.symlinks true |
---|
212 | - name: install cygwin with choco |
---|
213 | shell: bash {0} |
---|
214 | run: | |
---|
215 | choco --version |
---|
216 | choco install git python3 --source cygwin |
---|
217 | - name: Check out SageMath |
---|
218 | uses: actions/checkout@v2 |
---|
219 | with: |
---|
220 | repository: ${{ env.SAGE_REPO }} |
---|
221 | ref: ${{ env.SAGE_REF }} |
---|
222 | fetch-depth: 2000 |
---|
223 | if: env.SAGE_REPO != '' |
---|
224 | - name: Check out git-trac-command |
---|
225 | uses: actions/checkout@v2 |
---|
226 | with: |
---|
227 | repository: sagemath/git-trac-command |
---|
228 | path: git-trac-command |
---|
229 | if: env.SAGE_TRAC_GIT != '' |
---|
230 | - name: Check out SageMath from trac.sagemath.org |
---|
231 | shell: bash {0} |
---|
232 | # Random sleep and retry to limit the load on trac.sagemath.org |
---|
233 | run: | |
---|
234 | git config --global user.email "ci-sage@example.com" |
---|
235 | git config --global user.name "ci-sage workflow" |
---|
236 | if [ ! -d .git ]; then git init; fi; git remote add trac ${{ env.SAGE_TRAC_GIT }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch $SAGE_TICKET; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1 |
---|
237 | if: env.SAGE_TRAC_GIT != '' |
---|
238 | - uses: actions/download-artifact@v2 |
---|
239 | with: |
---|
240 | path: upstream |
---|
241 | name: upstream |
---|
242 | - name: install minimal prerequisites with choco |
---|
243 | shell: bash {0} |
---|
244 | run: | |
---|
245 | choco --version |
---|
246 | PACKAGES="python38 python38-pip" |
---|
247 | choco install $PACKAGES --source cygwin |
---|
248 | - name: Update Sage packages from upstream artifact |
---|
249 | run: | |
---|
250 | C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && ls -l upstream/ && export PATH="$(pwd)/build/bin:$PATH:/usr/local/bin:/usr/bin" && (cd upstream && bash -x update-pkgs.sh) && git diff' |
---|
251 | - name: tox |
---|
252 | run: | |
---|
253 | C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' |
---|
254 | C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' |
---|
255 | - name: Prepare logs artifact |
---|
256 | shell: bash |
---|
257 | run: | |
---|
258 | mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a || tar -c --ignore-failed-read -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a)-save.tar" $a ; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" |
---|
259 | if: always() |
---|
260 | - uses: actions/upload-artifact@v2 |
---|
261 | with: |
---|
262 | path: artifacts |
---|
263 | name: ${{ env.LOGS_ARTIFACT_NAME }} |
---|
264 | if: always() |
---|
265 | - name: Print out logs for immediate inspection |
---|
266 | # The markup in the output is a GitHub Actions logging command |
---|
267 | # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions |
---|
268 | shell: bash |
---|
269 | run: | |
---|
270 | find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; |
---|
271 | if: always() |
---|
272 | - name: Prepare sage-local artifact |
---|
273 | # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. |
---|
274 | # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. |
---|
275 | run: | |
---|
276 | C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files "${{ env.SAGE_LOCAL }}"' |
---|
277 | if: always() |
---|
278 | - uses: actions/upload-artifact@v2 |
---|
279 | # upload-artifact@v2 does not support whitespace in file names. |
---|
280 | # so we tar up the directory ourselves |
---|
281 | with: |
---|
282 | path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar |
---|
283 | name: ${{ env.LOCAL_ARTIFACT_NAME }} |
---|
284 | if: always() |
---|
285 | |
---|
286 | docker: |
---|
287 | runs-on: ubuntu-latest |
---|
288 | needs: [dist, kanarienvogel] |
---|
289 | strategy: |
---|
290 | fail-fast: false |
---|
291 | max-parallel: 32 |
---|
292 | matrix: |
---|
293 | tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, fedora-36, centos-7, centos-8, gentoo, archlinux-latest, opensuse-15, opensuse-15.3, opensuse-tumbleweed, slackware-14.2, conda-forge, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386, raspbian-buster-armhf] |
---|
294 | tox_packages_factor: [minimal, standard] |
---|
295 | env: |
---|
296 | TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} |
---|
297 | LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} |
---|
298 | DOCKER_TARGETS: configured with-targets with-targets-optional |
---|
299 | steps: |
---|
300 | - name: Check out SageMath |
---|
301 | uses: actions/checkout@v2 |
---|
302 | with: |
---|
303 | repository: ${{ env.SAGE_REPO }} |
---|
304 | ref: ${{ env.SAGE_REF }} |
---|
305 | fetch-depth: 2000 |
---|
306 | if: env.SAGE_REPO != '' |
---|
307 | - name: Check out git-trac-command |
---|
308 | uses: actions/checkout@v2 |
---|
309 | with: |
---|
310 | repository: sagemath/git-trac-command |
---|
311 | path: git-trac-command |
---|
312 | if: env.SAGE_TRAC_GIT != '' |
---|
313 | - name: Check out SageMath from trac.sagemath.org |
---|
314 | shell: bash {0} |
---|
315 | run: | |
---|
316 | git config --global user.email "ci-sage@example.com" |
---|
317 | git config --global user.name "ci-sage workflow" |
---|
318 | if [ ! -d .git ]; then git init; fi; git remote add trac ${{ env.SAGE_TRAC_GIT }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch $SAGE_TICKET; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1 |
---|
319 | if: env.SAGE_TRAC_GIT != '' |
---|
320 | - uses: actions/download-artifact@v2 |
---|
321 | with: |
---|
322 | path: upstream |
---|
323 | name: upstream |
---|
324 | - name: Install test prerequisites |
---|
325 | run: | |
---|
326 | sudo DEBIAN_FRONTEND=noninteractive apt-get update |
---|
327 | sudo DEBIAN_FRONTEND=noninteractive apt-get install tox python3-setuptools |
---|
328 | - name: Update Sage packages from upstream artifact |
---|
329 | run: | |
---|
330 | (export PATH=$(pwd)/build/bin:$PATH; (cd upstream && bash -x update-pkgs.sh) && sed -i.bak '/upstream/d' .dockerignore && echo "/:toolchain:/i ADD upstream upstream" | sed -i.bak -f - build/bin/write-dockerfile.sh && git diff) |
---|
331 | - name: Configure and build Sage distribution within a Docker container |
---|
332 | run: | |
---|
333 | set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;" |
---|
334 | - name: Copy logs from the Docker image or build container |
---|
335 | run: | |
---|
336 | mkdir -p "artifacts/$LOGS_ARTIFACT_NAME" |
---|
337 | cp -r .tox/$TOX_ENV/Dockerfile .tox/$TOX_ENV/log "artifacts/$LOGS_ARTIFACT_NAME" |
---|
338 | if [ -f .tox/$TOX_ENV/Dockertags ]; then CONTAINERS=$(docker create $(tail -1 .tox/$TOX_ENV/Dockertags) /bin/bash || true); fi |
---|
339 | if [ -n "$CONTAINERS" ]; then for CONTAINER in $CONTAINERS; do for ARTIFACT in /sage/logs; do docker cp $CONTAINER:$ARTIFACT artifacts/$LOGS_ARTIFACT_NAME && HAVE_LOG=1; done; if [ -n "$HAVE_LOG" ]; then break; fi; done; fi |
---|
340 | if: always() |
---|
341 | - uses: actions/upload-artifact@v2 |
---|
342 | with: |
---|
343 | path: artifacts |
---|
344 | name: ${{ env.LOGS_ARTIFACT_NAME }} |
---|
345 | if: always() |
---|
346 | - name: Print out logs for immediate inspection |
---|
347 | # and markup the output with GitHub Actions logging commands |
---|
348 | run: | |
---|
349 | .github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME" |
---|
350 | if: always() |
---|
351 | - name: Push Docker images |
---|
352 | run: | |
---|
353 | if [ -f .tox/$TOX_ENV/Dockertags ]; then |
---|
354 | TOKEN="${{ secrets.DOCKER_PKG_GITHUB_TOKEN }}" |
---|
355 | if [ -z "$TOKEN" ]; then |
---|
356 | TOKEN="${{ secrets.GITHUB_TOKEN }}" |
---|
357 | fi |
---|
358 | echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin |
---|
359 | for a in $(cat .tox/$TOX_ENV/Dockertags); do |
---|
360 | FULL_TAG=docker.pkg.github.com/$(echo ${{ github.repository }}|tr 'A-Z' 'a-z')/$a |
---|
361 | docker tag $a $FULL_TAG |
---|
362 | echo Pushing $FULL_TAG |
---|
363 | docker push $FULL_TAG |
---|
364 | done || echo "(Ignoring errors)" |
---|
365 | fi |
---|
366 | if: always() |
---|
367 | |
---|
368 | macos: |
---|
369 | |
---|
370 | runs-on: macos-latest |
---|
371 | strategy: |
---|
372 | fail-fast: false |
---|
373 | max-parallel: 4 |
---|
374 | matrix: |
---|
375 | os: [ macos-10.15, macos-11.0 ] |
---|
376 | tox_system_factor: [homebrew-macos, conda-forge-macos] |
---|
377 | tox_packages_factor: [minimal, standard] |
---|
378 | xcode_version_factor: [11.7, default] |
---|
379 | |
---|
380 | needs: [dist, kanarienvogel] |
---|
381 | |
---|
382 | env: |
---|
383 | TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} |
---|
384 | LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}-${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }} |
---|
385 | DOCKER_TARGETS: configured with-targets with-targets-optional |
---|
386 | |
---|
387 | steps: |
---|
388 | |
---|
389 | - name: Select Xcode version |
---|
390 | run: | |
---|
391 | if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi |
---|
392 | - name: Check out SageMath |
---|
393 | uses: actions/checkout@v2 |
---|
394 | with: |
---|
395 | repository: ${{ env.SAGE_REPO }} |
---|
396 | ref: ${{ env.SAGE_REF }} |
---|
397 | fetch-depth: 2000 |
---|
398 | if: env.SAGE_REPO != '' |
---|
399 | - name: Check out git-trac-command |
---|
400 | uses: actions/checkout@v2 |
---|
401 | with: |
---|
402 | repository: sagemath/git-trac-command |
---|
403 | path: git-trac-command |
---|
404 | if: env.SAGE_TRAC_GIT != '' |
---|
405 | - name: Check out SageMath from trac.sagemath.org |
---|
406 | shell: bash {0} |
---|
407 | run: | |
---|
408 | git config --global user.email "ci-sage@example.com" |
---|
409 | git config --global user.name "ci-sage workflow" |
---|
410 | if [ ! -d .git ]; then git init; fi; git remote add trac ${{ env.SAGE_TRAC_GIT }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch $SAGE_TICKET; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1 |
---|
411 | if: env.SAGE_TRAC_GIT != '' |
---|
412 | - uses: actions/download-artifact@v2 |
---|
413 | with: |
---|
414 | path: upstream |
---|
415 | name: upstream |
---|
416 | - name: Update Sage packages from upstream artifact |
---|
417 | run: | |
---|
418 | (export PATH=$(pwd)/build/bin:$PATH; (cd upstream && bash -x update-pkgs.sh) && git diff) |
---|
419 | |
---|
420 | - name: Install test prerequisites |
---|
421 | run: | |
---|
422 | brew install tox |
---|
423 | - name: Build and test with tox |
---|
424 | # We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts. |
---|
425 | # For doctesting, we use a lower parallelization to avoid timeouts. |
---|
426 | run: | |
---|
427 | MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS |
---|
428 | - name: Prepare logs artifact |
---|
429 | run: | |
---|
430 | mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME" |
---|
431 | if: always() |
---|
432 | - uses: actions/upload-artifact@v1 |
---|
433 | with: |
---|
434 | path: artifacts |
---|
435 | name: ${{ env.LOGS_ARTIFACT_NAME }} |
---|
436 | if: always() |
---|
437 | - name: Print out logs for immediate inspection |
---|
438 | # and markup the output with GitHub Actions logging commands |
---|
439 | run: | |
---|
440 | .github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME" |
---|
441 | if: always() |
---|