Skip to content

Commit 0b6bbb2

Browse files
committed
chore(ci): harden workflows
1 parent c12eca4 commit 0b6bbb2

2 files changed

Lines changed: 35 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,67 @@ on:
55
branches: [main]
66
workflow_call:
77

8+
concurrency:
9+
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
815
jobs:
916
lint-python:
1017
name: Ruff (Python)
1118
runs-on: ubuntu-latest
19+
timeout-minutes: 10
1220
steps:
1321
- uses: actions/checkout@v4
1422
- uses: astral-sh/ruff-action@v3
1523

1624
test-python:
1725
name: Unit Tests (Python)
1826
runs-on: ubuntu-latest
27+
timeout-minutes: 15
1928
steps:
2029
- uses: actions/checkout@v4
2130
- uses: actions/setup-python@v5
2231
with:
2332
python-version: "3.12"
24-
- shell: bash
33+
cache: "pip"
34+
- name: Install Python dependencies
2535
run: python -m pip install -r requirements.txt
26-
- shell: bash
36+
- name: Run Python unit tests
2737
run: python -m unittest discover -s tests -p 'test_*.py'
2838

2939
typecheck-ts:
3040
name: TypeScript (${{ matrix.os }})
3141
runs-on: ${{ matrix.os }}
42+
timeout-minutes: 10
3243
strategy:
44+
fail-fast: false
3345
matrix:
3446
os: [ubuntu-latest, windows-latest]
47+
defaults:
48+
run:
49+
working-directory: ui
3550
steps:
3651
- uses: actions/checkout@v4
3752
- uses: oven-sh/setup-bun@v2
38-
- shell: bash
39-
run: cd ui && bun install --frozen-lockfile 2>/dev/null || bun install
40-
- shell: bash
41-
run: cd ui && bun run typecheck
53+
- name: Install UI dependencies
54+
run: bun install --frozen-lockfile
55+
- name: Run TypeScript typecheck
56+
run: bun run typecheck
4257

4358
test-ts:
4459
name: Unit Tests (TypeScript)
4560
runs-on: ubuntu-latest
61+
timeout-minutes: 10
62+
defaults:
63+
run:
64+
working-directory: ui
4665
steps:
4766
- uses: actions/checkout@v4
4867
- uses: oven-sh/setup-bun@v2
49-
- shell: bash
50-
run: cd ui && bun install --frozen-lockfile 2>/dev/null || bun install
51-
- shell: bash
52-
run: cd ui && bun run test
68+
- name: Install UI dependencies
69+
run: bun install --frozen-lockfile
70+
- name: Run TypeScript unit tests
71+
run: bun run test

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches: [main]
66

7+
concurrency:
8+
group: release-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
permissions:
812
contents: write
913
issues: write
@@ -18,6 +22,7 @@ jobs:
1822
name: Package Check
1923
needs: ci
2024
runs-on: ubuntu-latest
25+
timeout-minutes: 10
2126
steps:
2227
- uses: actions/checkout@v4
2328
- uses: actions/setup-node@v4
@@ -30,6 +35,7 @@ jobs:
3035
name: Semantic Release
3136
needs: [ci, package]
3237
runs-on: ubuntu-latest
38+
timeout-minutes: 15
3339
if: github.repository == 'izzzzzi/izTeamSlots'
3440

3541
steps:

0 commit comments

Comments
 (0)