-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathreusable-python-build-and-test.yaml
More file actions
122 lines (117 loc) · 3.03 KB
/
Copy pathreusable-python-build-and-test.yaml
File metadata and controls
122 lines (117 loc) · 3.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
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
---
name: python-build-and-test
on:
workflow_call:
inputs:
runner:
description: Github hosted runner or Self hosted runner
required: false
type: string
default: ubuntu-latest
working-directory:
description: Working directory
required: false
type: string
default: ""
prefix:
description: Taskfile task prefix
required: false
type: string
default: ""
package:
description: Package name
required: false
type: string
default: "dist"
continue-on-error:
description: Whether to skip the status update for this job
required: false
type: boolean
default: false
py-lint:
description: Whether to run "task lint"
required: false
type: boolean
default: true
py-vuln:
description: Whether to run "task vuln"
required: false
type: boolean
default: true
py-test:
description: Whether to run "task coverage"
required: false
type: boolean
default: true
py-package:
description: Whether to run "task package"
required: false
type: boolean
default: true
permissions:
contents: read
jobs:
pylint:
runs-on: ubuntu-latest
if: ${{ inputs.py-lint }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup UV
id: setup-uv
uses: ./.github/actions/setup-python
with:
uv-install: true
- name: lint
run: |
task ${{ inputs.prefix && format('{0}:', inputs.prefix) || '' }}lint
pytest:
runs-on: ubuntu-latest
if: ${{ inputs.py-test }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup UV
id: setup-uv
uses: ./.github/actions/setup-python
with:
uv-install: true
- name: Run test
run: |
task ${{ inputs.prefix && format('{0}:', inputs.prefix) || '' }}test
pypackage:
runs-on: ubuntu-latest
if: ${{ inputs.py-package }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup UV
id: setup-uv
uses: ./.github/actions/setup-python
with:
uv-install: true
- name: Build package
run: |
task ${{ inputs.prefix && format('{0}:', inputs.prefix) || '' }}packaging
- name: Show packages
run: |
ls -la ./dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.package }}
if-no-files-found: error
path: ${{ inputs.working-directory }}/dist