-
Notifications
You must be signed in to change notification settings - Fork 6
127 lines (106 loc) · 4.09 KB
/
ci.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
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
# We run CI on pushes to the main branch
push:
branches:
- main
# and on all pull requests to the main branch
pull_request:
branches:
- main
# as well as upon manual triggers through the 'Actions' tab of the Github UI
workflow_dispatch:
# Additionally, we run Monday morning 6AM, so that we can react quickly if things break
schedule:
- cron: "0 5 * * 1"
env:
CATCH2_VERSION: 2.13.9
jobs:
test:
name: Testing on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# We test on the oldest and newest supported Python versions
# Unfortenately, we can't test on the latest Python version, as the
# pytest-virtualenv plugin does not support it yet, see
# https://github.com/man-group/pytest-plugins/issues/220
python-version: ["3.8", "3.11"]
steps:
- name: Checking out the cookie cutter repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test requirements
run: |
python -m pip install -r requirements-dev.txt
- uses: ssciwr/doxygen-install@v1
- name: Install Catch2 (Linux + MacOS)
if: runner.os != 'Windows'
run: |
git clone -b v$CATCH2_VERSION https://github.com/catchorg/Catch2.git
cd Catch2
mkdir build
cd build
cmake -DBUILD_TESTING=OFF ..
sudo cmake --build . --target install
- name: Install Catch2 (Windows)
if: runner.os == 'Windows'
run: |
git clone -b v$Env:CATCH2_VERSION https://github.com/catchorg/Catch2.git
cd Catch2
mkdir build
cd build
cmake -DBUILD_TESTING=OFF ..
cmake --build . --target install
- name: Set up git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "SSC CI Test User"
- name: Set up Windows git configuration
if: runner.os == 'Windows'
run: |
git config --system core.longpaths true
- name: Run regular test suite
run: |
python -m pytest -m local
deploy-test:
name: Deploying to hosters and run their CI
runs-on: ubuntu-latest
steps:
- name: Checking out the cookie cutter repository
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install test requirements
run: |
python -m pip install -r requirements-dev.txt
- name: Set up git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "SSC CI Test User"
- name: Set up SSH Agent to deploy to test repositories
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GHA_TEST_PRIVATE_KEY }}
- name: Add gitlab.com to the list of known hosts
run: |
echo "gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9" >> ~/.ssh/known_hosts
- name: Test deploying the baked project to Github + Gitlab.com
run: |
python -m pytest -m deploy
- name: Run tests for upstream integrations
env:
CODECOV_GH_API_ACCESS_TOKEN: ${{ secrets.CODECOV_GH_API_ACCESS_TOKEN }}
CODECOV_GL_API_ACCESS_TOKEN: ${{ secrets.CODECOV_GL_API_ACCESS_TOKEN }}
GH_API_ACCESS_TOKEN: ${{ secrets.GH_API_ACCESS_TOKEN }}
GL_API_ACCESS_TOKEN: ${{ secrets.GL_API_ACCESS_TOKEN }}
RTD_API_ACCESS_TOKEN: ${{ secrets.RTD_API_ACCESS_TOKEN }}
run: |
python -m pytest -m integrations