-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.43 KB
/
ci-macos.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
name: CI - macOS
on:
workflow_dispatch:
pull_request:
branches:
- main
- develop
- 'feature/*'
- 'hotfix/*'
- 'release/*'
- 'fixes/*'
push:
branches:
- main
- develop
jobs:
pre-commit:
name: Pre-commit CI (macOS)
runs-on: macos-12
if: (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'macos-ci-test'))
strategy:
matrix:
python-version: [ "3.10" ]
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# this is required due to the docker dependency for the secret scanning tool TruffleHog
- name: Setup docker (not included on macOS runners)
run: |
brew install docker
colima start
- name: Run Pre-commit
uses: pre-commit/[email protected]
ci-tests:
name: Pytest CI (macOS)
runs-on: macos-12
if: (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'macos-ci-test'))
needs: pre-commit
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
# venv as a `.venv` in your testing directory, which allows the next step to easily
# cache it.
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`).
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# Install dependencies if cache does not exist
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install
- name: Run the full test suite
run: poetry run python -m pytest