This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 411
101 lines (86 loc) · 3.04 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
name: Build & Test using Conda
on:
pull_request:
types: [opened, synchronize]
push:
tags:
- '*'
branches:
- 'public/build/**-runci'
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 }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [3.8, 3.9]
conda-env: [environment, environment-optional]
steps:
- uses: actions/checkout@v3
- name: Check for Miniconda
id: check_conda
run: echo ::set-output name=installed::$CONDA
# Miniconda is installed by default in the ubuntu-latest, however not in the act-image to run it locally
- name: Install Miniconda
if: steps.check_conda.outputs.installed == ''
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV
- name: Create conda environment files
run: ./bootstrap-conda
- name: Cache conda packages
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ hashFiles('src/environment.yml') }}
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: sage-build
environment-file: src/${{ matrix.conda-env }}.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 $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt); 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: |
pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
pip install --no-build-isolation -v -v -e ./src
env:
SAGE_NUM_THREADS: 2
- name: Test
shell: bash -l {0}
run: ./sage -t --all -p0
- name: Print logs
run: |
for file in $(find . -type f -name "*.log"); do
echo "::group::$file"
cat "$file"
echo "::endgroup::"
done
if: always()