-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (44 loc) · 1.18 KB
/
python-job.yml
File metadata and controls
50 lines (44 loc) · 1.18 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
name: Python Job
on:
workflow_call:
inputs:
python-version:
type: string
default: "3.12"
run:
required: true
type: string
artifact:
type: string
default: 'no-artifact-${{ github.actor_id }}-${{ github.head_ref || github.ref }}'
required: false
artifact_path:
type: string
default: 'does/not/exist'
required: false
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: "${{ github.head_ref || github.ref }}"
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: ${{ inputs.python-version }}
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Run Command
run: |
${{ inputs.run }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact }}
path: ${{ inputs.artifact_path }}
if-no-files-found: ignore