-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (121 loc) · 4.21 KB
/
Copy pathci.yml
File metadata and controls
134 lines (121 loc) · 4.21 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
128
129
130
131
132
133
134
---
name: CI
permissions: {}
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
PYTHON_VERSION: '3.14'
jobs:
release-setup:
name: Release Setup
outputs:
publish_release: ${{ steps.release-setup.outputs.publish_release }}
release_body: ${{ steps.release-setup.outputs.release_body }}
release_commit: ${{ steps.release-setup.outputs.release_commit }}
release_generate_release_notes: ${{ steps.release-setup.outputs.release_generate_release_notes }}
release_tag: ${{ steps.release-setup.outputs.release_tag }}
release_version: ${{ steps.release-setup.outputs.release_version }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Release Setup
id: release-setup
uses: LizardByte/actions/actions/release_setup@a46850981292c4bbc0c41715f286ad95adaaaf4a # v2026.625.20301
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pytest:
name: Pytest (${{ matrix.os }})
needs:
- release-setup
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python
id: setup-python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Sync Python tools
env:
UV_PYTHON: ${{ steps.setup-python.outputs.python-path }}
run: uv sync --locked --only-group test-python
- name: Test with pytest
id: test
run: uv run --locked --only-group test-python pytest
- name: Upload test coverage
# any except canceled or skipped
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
fail_ci_if_error: true
files: ./coverage/python-coverage.xml
flags: ${{ runner.os }}
report_type: coverage
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Upload test results
# any except canceled or skipped
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
fail_ci_if_error: true
files: ./junit-python.xml
flags: ${{ runner.os }}
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
create-release:
name: Create Release
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/master') &&
needs.release-setup.outputs.publish_release == 'true'
needs:
- release-setup
- pytest
permissions: {}
runs-on: ubuntu-latest
steps:
- name: Create/Update GitHub Release
uses: LizardByte/actions/actions/release_create@a46850981292c4bbc0c41715f286ad95adaaaf4a # v2026.625.20301
with:
allowUpdates: true
artifacts: ''
body: ${{ needs.release-setup.outputs.release_body }}
draft: true
generateReleaseNotes: ${{ needs.release-setup.outputs.release_generate_release_notes }}
name: ${{ needs.release-setup.outputs.release_tag }}
prerelease: true
tag: ${{ needs.release-setup.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}