-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (79 loc) · 2.45 KB
/
workflow.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
name: minisgnxml workflow
on: [push, pull_request]
permissions:
actions: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
PYTHON_VERSIONS: '["3.8", "3.9", "3.10", "3.11", "3.12"]'
POETRY_VERSION: 1.8.3
jobs:
# workaround since matrix can not access `env` but can access `needs`
python-versions:
runs-on: "ubuntu-latest"
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
steps:
- id: set-versions
run: echo "versions=$PYTHON_VERSIONS" >> $GITHUB_OUTPUT
poetry-lock:
needs: python-versions
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry lock
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
pytest:
needs: [poetry-lock, python-versions]
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
- run: poetry install
- run: |
sudo apt-get update && sudo apt-get install -y xmlsec1
xmlsec1 --version
- run: poetry run pytest
pre-commit:
needs: [poetry-lock, python-versions]
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
- run: poetry install
- uses: pre-commit/actions@v3.0.1