generated from inovintell/template
-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (71 loc) · 2.04 KB
/
python-tests.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
---
name: Python Tests
on:
pull_request:
branches:
- main
paths:
- src/**
- test/**
- pyproject.toml
- poetry.lock
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
if: ${{ ! contains(github.repository, 'template') }}
strategy:
matrix:
py:
- '3.11'
- '3.10'
- '3.9'
os:
- ubuntu-latest
- macos-latest
name: >
${{ matrix.os }} | py-${{ matrix.py }}
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Dependencies
uses: ./.github/actions/setup-poetry
with:
python-version: ${{ matrix.py }}
flags: --only test,main
key: test
- name: Run Python tests
uses: ./.github/actions/python-test
with:
coverage-name: ${{ matrix.os }}-py-${{ matrix.py }}-coverage
test-report-name: ${{ matrix.os }}-py-${{ matrix.py }}-tests
coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Dependencies
uses: ./.github/actions/setup-poetry
- name: Upload combined coverage
uses: ./.github/actions/python-coverage