-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (69 loc) · 2.03 KB
/
test-pre-python-impl.yml
File metadata and controls
75 lines (69 loc) · 2.03 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
name: ⚙️ Test pre-python
on:
workflow_call:
inputs:
ref:
description: Git commit reference.
required: true
type: string
head-ref:
description: Git HEAD commit reference (branch name).
required: false
type: string
default: ""
pytest-args:
description: >
Template parameter.
Extra arguments to pass to pytest.
required: true
type: string
python-versions:
required: false
type: string
description: The JSON array of Python versions to test with.
default: '["3.13-dev"]'
poetry-version:
required: false
type: string
description: Version of Poetry.
default: "2.1.3"
# Don't run simultaneously on the same branch (since we may commit to that branch)
concurrency: ci-${{ inputs.head-ref && format('refs/heads/{0}', inputs.head-ref) || inputs.ref }}
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Cache dependencies
uses: hpcflow/github-support/init-cache@0.4
with:
name: test
version: ${{ matrix.python-version }}
- name: Set up poetry
uses: hpcflow/github-support/setup-poetry@0.4
with:
version: ${{ inputs.poetry-version }}
- name: Install dependencies
run: |
poetry install --without dev,pyinstaller
- name: Run tests
run: |
poetry run python -m pytest ${{ inputs.pytest-args }}
env:
PYTHONUNBUFFERED: ok