-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (85 loc) · 2.78 KB
/
test.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
name: Run Cookiecutter Tests
on:
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
pull_request:
push:
branches:
- master
jobs:
run_test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
name: Run pytest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge,nodefaults
python-version: ${{ matrix.python-version }}
- name: Install Mac dependencies
if: runner.os == 'macOS'
run: |
brew install coreutils direnv
which python
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
conda config --add channels conda-forge
conda config --add channels nodefaults
$CONDA/bin/conda init bash
- name: Fix Conda permissions on macOS
if: runner.os == 'macOS'
run: sudo chown -R $UID $CONDA
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y && sudo apt-get install -y direnv
which python
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
conda config --add channels conda-forge
conda config --add channels nodefaults
$CONDA/bin/conda init bash
- name: Build docs
run: |
cd docs
which python
python -m mkdocs build
- name: Git config
run: |
git config --global user.email [email protected]
git config --global user.name "Github Actions"
- name: "Set up SSH agent"
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Add GitHub to the SSH known hosts file"
run: |
for ip in $(dig @8.8.8.8 github.com +short); do \
ssh-keyscan github.com,$ip; \
ssh-keyscan $ip; \
done 2>/dev/null >> ~/.ssh/known_hosts
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Run pytest
run: |
which python
python -m pytest -vvv