-
Notifications
You must be signed in to change notification settings - Fork 6
127 lines (109 loc) · 3.42 KB
/
Copy pathci.yml
File metadata and controls
127 lines (109 loc) · 3.42 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
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 Workflow
on:
push:
branches:
- main
tags:
- rel/**
pull_request:
branches:
- main
permissions: read-all
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10.14'
- name: Install dev dependencies
run: pip install -r requirements-dev.txt
- name: Run pre-commit linting
run: pre-commit run --all-files
system-tests:
name: System Tests
runs-on: windows-latest
environment: system-tests
needs: [tests,lint]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/rel/'))
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install test dependencies
run: pip install -r requirements-test.txt
- name: Run system tests with tox
run: tox -e system_tests
env:
DAR_CLIENT_ID: ${{ secrets.DAR_CLIENT_ID }}
DAR_CLIENT_SECRET: ${{ secrets.DAR_CLIENT_SECRET }}
DAR_AUTH_URL: ${{ secrets.DAR_AUTH_URL }}
DAR_URL: ${{ secrets.DAR_URL }}
- name: Create Github Release for Tag
if: startsWith(github.ref, 'refs/tags/rel/')
uses: softprops/action-gh-release@v2
with:
body: "Tagging release ${{ github.ref }}"
files: system_test_results/traceability.html
tests:
name: Tests on Linux, Windows and macOS environments
runs-on: ${{ matrix.os}}
strategy:
matrix:
include:
- python-version: '3.10'
toxenv: 'py310-cov'
os: ubuntu-latest
- python-version: '3.11'
toxenv: 'py311-cov'
os: ubuntu-latest
- python-version: 'pypy3.10'
toxenv: 'pypy3-cov'
os: ubuntu-latest
- python-version: '3.10'
toxenv: 'py310-cov'
os: windows-latest
- python-version: '3.10'
toxenv: 'py310-cov'
os: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: pip install -r requirements-test.txt
- name: Run tests with tox
run: tox -e ${{ matrix.toxenv }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy to PyPI
runs-on: ubuntu-latest
needs: [system-tests]
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/rel/')
permissions:
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build distributions
run: pipx run build --sdist --wheel
- name: Deploy release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1 # Uses OIDC/Workload identities and doesn't require a token