-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.42 KB
/
ci.yml
File metadata and controls
62 lines (52 loc) · 1.42 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
runner:
description: 'Choose runner'
default: 'self-hosted'
type: choice
options:
- self-hosted
- ubuntu-latest
jobs:
setup:
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.set-runner.outputs.runner }}
steps:
- name: Determine runner
id: set-runner
run: |
# Use input runner if available, else default to self-hosted
SELECTED_RUNNER="${{ github.event.inputs.runner }}"
if [ -z "$SELECTED_RUNNER" ]; then
SELECTED_RUNNER="self-hosted"
fi
echo "runner=$SELECTED_RUNNER" >> $GITHUB_OUTPUT
test:
needs: setup
runs-on: ${{ needs.setup.outputs.runner }}
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run Linting (Ruff)
run: uv run ruff check .
- name: Run Formatting Check (Ruff)
run: uv run ruff format --check .
- name: Run Tests
run: uv run pytest
env:
ASSEMBLY_API_KEY: ${{ secrets.ASSEMBLY_API_KEY }}