Repository navigation
53 lines (43 loc) · 1.47 KB
/
Copy pathci.yml
File metadata and controls
53 lines (43 loc) · 1.47 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
name: "Continuous Integration"
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Disallow all GITHUB_TOKEN permissions by default
permissions: {}
# Only allow 1 concurrent set of CI jobs per PR or branch name. Cancel any others.
# Why:
# - https://cambridge-iccs.github.io/green-ci/best_practices.html#concurrency
# - https://docs.zizmor.sh/audits/#concurrency-limits
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: "Test"
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry to use in-project virtualenv
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
id: cache-venv
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: .venv
key: venv-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install
- name: Run tests
run: poetry run pytest tests/