106 lines
2.0 KiB
YAML
106 lines
2.0 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-frontend:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Setup repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run build
|
|
run: npm run build
|
|
|
|
- name: Run checks
|
|
run: |
|
|
npm run check
|
|
npm test
|
|
|
|
test-go:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Setup repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
make build
|
|
|
|
- name: Run Go tests
|
|
run: go test ./server/... -v -timeout 300s
|
|
|
|
- name: Run Go tests with coverage
|
|
run: go test ./server/... -coverprofile=coverage.out -timeout 300s
|
|
|
|
- name: Display test coverage
|
|
run: go tool cover -func=coverage.out
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Setup repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: make build
|
|
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install chromium
|
|
|
|
- name: Run e2e tests
|
|
run: npx playwright test
|
|
|
|
- name: Upload test results
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-report
|
|
path: test-results/
|
|
retention-days: 7
|