Skip to content

Commit 7f07f02

Browse files
author
aligneddev
committed
add Github actions CI
1 parent f53e301 commit 7f07f02

2 files changed

Lines changed: 98 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
verify:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 40
20+
env:
21+
CI: "true"
22+
DOTNET_NOLOGO: "true"
23+
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup .NET from global.json
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
global-json-file: global.json
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 24
38+
cache: npm
39+
cache-dependency-path: package-lock.json
40+
41+
- name: Restore .NET dependencies
42+
run: dotnet restore BikeTracking.slnx
43+
44+
- name: Run backend tests
45+
run: dotnet test BikeTracking.slnx --configuration Release --no-restore --verbosity minimal
46+
47+
- name: Install frontend dependencies
48+
working-directory: BikeTracking.Frontend
49+
run: npm ci
50+
51+
- name: Install Playwright browser and system dependencies
52+
working-directory: BikeTracking.Frontend
53+
run: npx playwright install --with-deps chromium
54+
55+
- name: Frontend lint
56+
working-directory: BikeTracking.Frontend
57+
run: npm run lint
58+
59+
- name: Frontend build
60+
working-directory: BikeTracking.Frontend
61+
run: npm run build
62+
63+
- name: Frontend unit tests
64+
working-directory: BikeTracking.Frontend
65+
run: npm run test:unit
66+
67+
- name: Frontend end-to-end tests
68+
working-directory: BikeTracking.Frontend
69+
run: npm run test:e2e
70+
71+
- name: Upload Playwright artifacts on failure
72+
if: failure()
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: playwright-artifacts
76+
path: |
77+
playwright-report
78+
test-results
79+
if-no-files-found: ignore
80+
retention-days: 14
81+
82+
- name: Cleanup sqlite files
83+
if: always()
84+
run: |
85+
rm -f biketracking.local.db
86+
rm -f biketracking.local.db-shm
87+
rm -f biketracking.local.db-wal

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ For local-first deployment to end-user machines, the default persistence model i
7676
- Before schema upgrades, create a safety backup copy of the SQLite file.
7777
- Use SQL Server LocalDB or SQL Server Express only when local multi-user requirements exceed the single-user SQLite profile.
7878

79-
## Next Step
8079

81-
Continue with task execution and verification using specs/001-user-signup-pin/tasks.md.
80+
## Automated Tests
81+
82+
frontend unit tests: `npm run test:unit` (Vitest)
83+
84+
frontend end-to-end tests: `npm run test:e2e` (Playwright)
85+
- These use the local SQLlite database, so they are more like integration tests. The values are thrown away after each test, but they do test the full stack of the API and database layers.
86+
87+
backend tests: `dotnet test` from repo root (xUnit)
88+
89+
These are ran in the .github\workflows\ci.yml pipeline on every PR
90+

0 commit comments

Comments
 (0)