forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 1
169 lines (147 loc) · 5.64 KB
/
Copy pathci.yml
File metadata and controls
169 lines (147 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: CI
on:
push:
tags:
- '*'
pull_request:
paths:
- '**.build'
- 'uv.lock'
- 'subprojects/**'
- '.github/workflows/ci.yml'
- 'build/pkgs/*/distros/*.txt'
workflow_dispatch:
# Allow to run manually
jobs:
linux:
name: Build and Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container:
- fedora:41
- fedora:42
- fedora:43
- debian:forky
- ghcr.io/void-linux/void-glibc-full
- archlinux
#- ubuntu:22.04 - gap is outdated there (only 4.11)
- ubuntu:24.04
- ubuntu:26.04
container:
image: ${{ matrix.container }}
steps:
- name: Prepare container
run: |
if [ "${{ matrix.container }}" = "ghcr.io/void-linux/void-glibc-full" ]; then
xbps-install -Syu xbps
xbps-install -yu
# node-based actions require libstdc++.so.6
xbps-install -Sy libstdc++ bash git
# setup-uv needs a version field in os-release to build its cache
# key, but rolling-release Void ships none (only ID); give it the
# same BUILD_ID that Arch uses (see astral-sh/setup-uv#773)
echo 'BUILD_ID=rolling' >> /etc/os-release
fi
if [ "${{ matrix.container }}" = "archlinux" ]; then
# The archlinux container is configured to not install docs by default
# but we need the maxima help to be in place
sed -i '/^NoExtract/d' /etc/pacman.conf
fi
if [ "${{ matrix.container }}" = "ubuntu:22.04" ]; then
apt-get update
apt-get install -y git
fi
- name: Checkout code
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
# We cannot use the setup python action because it doesn't support all containers
# https://github.com/actions/setup-python/issues/527
- name: Set up Python
run: |
uv python install
if [ "${{ matrix.container }}" = "ghcr.io/void-linux/void-glibc-full" ] || [ "${{ matrix.container }}" = "archlinux" ]; then
uv venv --system-site-packages
else
uv venv
fi
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install dependencies
run: |
SYSTEM=$(build/bin/sage-guess-package-system)
if [ "$SYSTEM" = "fedora" ]; then
dnf install -y git
# Need to use --setopt=tsflags="" to avoid errors with gphelp
dnf install -y pari-gp --setopt=tsflags=""
# Mitigate upstream packaging bug: https://bugzilla.redhat.com/show_bug.cgi?id=2332429
# by swapping the incorrectly installed OpenCL-ICD-Loader for the expected ocl-icd
dnf -y swap --repo='fedora' OpenCL-ICD-Loader ocl-icd
fi
eval $(build/bin/sage-print-system-package-command $SYSTEM update)
eval $(build/bin/sage-print-system-package-command $SYSTEM --yes --ignore-missing install $(build/bin/sage-get-system-packages $SYSTEM $(uv run --no-project build/bin/sage-package list :standard:)))
- name: Build
run: |
# Install build dependencies manually as workaround for https://github.com/astral-sh/uv/issues/1516
uv sync --frozen --inexact --no-install-project -v
uv sync --frozen --inexact --no-build-isolation -v
- name: Test
run: |
uv run --frozen ./sage -t --all -p4 || true
- name: Clear container name
id: clear-container-name
if: failure() || success()
run: |
# Output the container name, but with ":" and "/" replaced by "-"
# This is needed to avoid issues with the upload-artifact action
CONTAINER_NAME=$(echo "${{ matrix.container }}" | tr ':/' '--')
echo "CONTAINER_NAME=$CONTAINER_NAME" >> $GITHUB_OUTPUT
- name: Upload log
uses: actions/upload-artifact@v7
if: failure() || success()
with:
name: ${{ steps.clear-container-name.outputs.CONTAINER_NAME }}-log
path: |
build/cp313/meson-logs/
build/cp313/meson-info/
macos:
name: Build and Test (macos-${{ matrix.version }})
runs-on: macos-${{ matrix.version }}
strategy:
fail-fast: false
matrix:
version:
- '15'
- '26'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install dependencies
run: |
eval $(build/bin/sage-print-system-package-command homebrew update)
eval $(build/bin/sage-print-system-package-command homebrew --yes --ignore-missing install $(build/bin/sage-get-system-packages homebrew $(uv run --no-project build/bin/sage-package list :standard:)))
- name: Build
run: |
source ./.homebrew-build-env
# Install build dependencies manually as workaround for https://github.com/astral-sh/uv/issues/1516
uv sync --frozen --inexact --no-install-project -v
uv sync --frozen --inexact --no-build-isolation -v
- name: Test
run: |
uv run --frozen ./sage -t --all -p4 || true
- name: Upload log
uses: actions/upload-artifact@v7
if: failure() || success()
with:
name: macos-${{ matrix.version }}-log
path: |
build/cp312/meson-logs/
build/cp312/meson-info/