-
-
Notifications
You must be signed in to change notification settings - Fork 481
116 lines (102 loc) · 4.03 KB
/
ci-conda.yml
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
name: Build & Test using Conda
on:
push:
tags:
- '*'
branches:
- 'public/build/**-runci'
pull_request:
workflow_dispatch:
# Allow to run manually
concurrency:
# Cancel previous runs of this workflow for the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Conda
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
# On pushes to tags or branches, test the whole matrix.
os: >-
${{ github.event_name == 'pull_request'
&& fromJson('["ubuntu"]')
|| fromJson('["ubuntu", "macos"]') }}
python: >-
${{ github.event_name == 'pull_request'
&& fromJson('["3.9"]')
|| fromJson('["3.9", "3.10", "3.11"]') }}
# Optional environment is disabled for now as its not yet working
# environment: [environment, environment-optional]
conda-env: [environment]
# On pull requests, only test two jobs:
# Ubuntu with Python 3.9, macOS with Python 3.10.
# Build & Test currently uses Python 3.11 (on ubuntu-focal).
# Together, they cover the supported minor Python versions.
include: >-
${{ github.event_name == 'pull_request'
&& fromJson('[{"os": "macos", "python": "3.10", "conda-env": "environment"}]')
|| fromJson('[]') }}
steps:
- uses: actions/checkout@v4
- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}
- name: Cache conda packages
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ hashFiles('src/environment-3.11.yml') }}
- name: Setup Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true
activate-environment: sage
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && 'macos' || 'linux' }}.yml
- name: Print Conda environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Configure
shell: bash -l {0}
continue-on-error: true
run: |
./bootstrap
echo "::add-matcher::.github/workflows/configure-systempackage-problem-matcher.json"
./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX --enable-system-site-packages $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt --exclude rpy2); do echo --with-system-$pkg=force; done)
echo "::remove-matcher owner=configure-system-package-warning::"
echo "::remove-matcher owner=configure-system-package-error::"
- name: Build
shell: bash -l {0}
run: |
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda.
pip install --no-build-isolation --no-deps -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
pip install --no-build-isolation --no-deps --config-settings editable_mode=compat -v -v -e ./src
env:
SAGE_NUM_THREADS: 2
- name: Verify dependencies
if: success() || failure()
shell: bash -l {0}
run: pip check
- name: Test
if: success() || failure()
shell: bash -l {0}
run: ./sage -t --all --baseline-stats-path=.github/workflows/ci-conda-known-test-failures.json -p0
- name: Print logs
if: always()
run: |
for file in $(find . -type f -name "*.log"); do
echo "::group::$file"
cat "$file"
echo "::endgroup::"
done