-
Notifications
You must be signed in to change notification settings - Fork 16
69 lines (57 loc) · 1.85 KB
/
ci.yml
File metadata and controls
69 lines (57 loc) · 1.85 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
# .github/workflows/ci.yml
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
# Prevents multiple runs on the same PR from overlapping
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality-gate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to see commit history and changed files
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: '1.3.1'
# Bun install is fast enough that complex caching of node_modules often adds more overhead than it saves.
# We'll rely on Bun's speed. If needed, we can cache ~/.bun/install/cache.
- name: Install dependencies
run: bun install
# Quality Checks
- name: Check Formatting (warning only)
id: format
continue-on-error: true
run: |
bun run format:check || echo "::warning::Formatting issues detected. Run 'bun run format' locally."
- name: Type Check
id: types
continue-on-error: true
run: bun run typecheck
- name: Run Tests
id: tests
continue-on-error: true
run: bun run test
- name: Production Build
id: build
continue-on-error: true
run: bun run build
- name: Smoke Test
id: smoke
continue-on-error: true
run: bun run test:smoke
- name: Fail Job if Errors
if: always()
run: |
if [ "${{ steps.types.outcome }}" = "failure" ] || \
[ "${{ steps.tests.outcome }}" = "failure" ] || \
[ "${{ steps.build.outcome }}" = "failure" ] || \
[ "${{ steps.smoke.outcome }}" = "failure" ]; then
echo "One or more checks failed."
exit 1
fi