Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

# A new commit on the same branch cancels the run for the older one
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: backend/package-lock.json
- run: npm ci
- run: npm test

frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
# Without --no-fix the lint script rewrites files and passes
- run: npm run lint -- --no-fix
- run: npm run build

browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker compose up --build -d
- name: Wait for the API
run: |
for i in $(seq 1 60); do
curl -s -o /dev/null http://localhost:8080/api/events && exit 0
sleep 5
done
echo "API did not answer within 5 minutes"
exit 1
- run: tests/browser/run.sh
- if: failure()
run: docker compose logs
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The containers run built copies of the code, so after editing, run `docker compo

To check the app in a headless browser, run `tests/browser/run.sh` while the stack is up; see [`tests/browser/`](tests/browser/).

Every pull request runs the backend tests, the frontend lint and build, and these browser checks (see [`.github/workflows/ci.yml`](.github/workflows/ci.yml)).

## License

[MIT](LICENSE)
Loading