-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
126 lines (113 loc) · 3.88 KB
/
action.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
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
name: ozi-checkpoint
description: "OZI continous integration checkpoint action."
author: "Ross J. Duff (Eden Rose) MSc <[email protected]>"
branding:
icon: check-circle
color: green
inputs:
python-version:
description: "Python version to checkpoint"
required: true
parallel:
description: "Whether to run checkpoints in parallel."
required: true
default: "true"
os:
description: "Operating system to run on"
required: false
default: "ubuntu-latest"
args:
description: posargs for tox
required: false
default: ""
runs:
using: "composite"
steps:
- name: Get OZI specification API
id: api
run: |
echo "tox=$( curl -L https://oziproject.dev/api.json | jq -c '.spec.python.ci.backend.tox' )" >> $GITHUB_OUTPUT
echo "tox-gh=$( curl -L https://oziproject.dev/api.json | jq -c '.spec.python.ci.backend."tox-gh"' )" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
id: setup-python
with:
cache: 'pip'
cache-dependency-path: |
.tox/**/tmp/**/requirements.txt
python-version: '${{ inputs.python-version }}'
allow-prereleases: true
check-latest: true
- name: Install CI backend
run: |
python -m pip install --user -r ${GITHUB_ACTION_PATH}/requirements.txt
shell: bash
- name: Setup pipx path
run: |
pipx ensurepath --force
shell: bash
- name: Install meson (pipx)
run: |
pipx install meson --force
shell: bash
- name: Migrate pipx path for Windows
if: ${{ inputs.os == 'windows-latest' }}
run: |
cache_dir=$(pipx environment --value PIPX_VENV_CACHEDIR)
logs_dir=$(pipx environment --value PIPX_LOG_DIR)
trash_dir=$(pipx environment --value PIPX_TRASH_DIR)
home_dir=$(pipx environment --value PIPX_HOME)
# If you wish another location, replace the expression below
# and set `NEW_LOCATION` explicitly
NEW_LOCATION="D:\\a\\pipx"
rm -rf "$cache_dir" "$logs_dir" "$trash_dir"
mkdir -p $NEW_LOCATION && mv "$home_dir" $NEW_LOCATION
pipx reinstall-all
shell: bash
- name: 'Run tests (First Try)'
if: ${{ inputs.parallel != 'true' }}
continue-on-error: true
id: setup1
run: |
tox
shell: bash
- name: 'Run tests (First Try)'
if: ${{ inputs.parallel == 'true' }}
continue-on-error: true
id: setup2
run: |
tox run-parallel --parallel-no-spinner
shell: bash
- name: Check binary wheel is buildable from sdist
run: |
tox -e invoke -- release --no-cibuildwheel
shell: bash
- name: 'Run tests (Second Try)'
if: ${{ (steps.setup1.outcome == 'failure') && (inputs.parallel != 'true') }}
run: |
tox -r -- ${{ inputs.args }}
shell: bash
- name: 'Run tests (Second Try)'
if: ${{ (steps.setup2.outcome == 'failure') && (inputs.parallel == 'true') }}
run: |
tox run-parallel -r --parallel-no-spinner -- ${{ inputs.args }}
shell: bash
- uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46
with:
inputs: |
.tox/dist/tmp/meson-logs/testlog-dist.txt
.tox/lint/tmp/meson-logs/testlog-lint.txt
.tox/test/tmp/meson-logs/testlog-test.txt
upload-signing-artifacts: true
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
if: always()
with:
name: ${{ inputs.os }}-${{ inputs.python-version }}-checkpoint
path: |
.tox/dist/tmp/meson-logs/testlog-dist.txt
.tox/lint/tmp/meson-logs/testlog-lint.txt
.tox/test/tmp/meson-logs/testlog-test.txt