forked from MrBlenny/py-d2
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 1.53 KB
/
run.yaml
File metadata and controls
56 lines (53 loc) · 1.53 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
name: Run Project
on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
script_name:
description: 'uv script name'
required: true
default: ''
env:
UV_SCRIPT_NAME_LIST: 'example'
jobs:
run-project:
name: Run project on ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || github.event.inputs.script_name != ''
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: |
uv sync --all-extras --dev
- name: Run uv script
run: |
if [ -z "${{ github.event.inputs.script_name }}" ]; then
echo "No script name provided, running all scripts"
for script_name in $(echo "${{ env.UV_SCRIPT_NAME_LIST }}" | tr "," " ")
do
echo "Running uv script $script_name"
uv run $script_name
done
else
echo "Running uv script ${{ github.event.inputs.script_name }}"
uv run ${{ github.event.inputs.script_name }}
fi