Skip to content
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
matrix:
include:
- image-name: prompt-edu/tease-client
docker-file: ./client/Dockerfile
docker-context: ./client
docker-file: ./client-react/Dockerfile
docker-context: ./client-react
- image-name: prompt-edu/tease-server
docker-file: ./server/Dockerfile
docker-context: ./server
docker-file: ./server-go/Dockerfile
docker-context: ./server-go
uses: ls1intum/.github/.github/workflows/build-and-push-docker-image.yml@v1.2.0
secrets: inherit
with:
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test

on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test-go:
name: Go Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: server-go/go.sum

- name: Run Go tests with race detector
working-directory: server-go
run: go test ./... -race -coverprofile=coverage.out

- name: Upload Go coverage
uses: actions/upload-artifact@v4
with:
name: go-coverage
path: server-go/coverage.out

test-react:
name: React Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: client-react/package-lock.json

- name: Install dependencies
working-directory: client-react
run: npm ci

- name: Run unit tests with coverage
working-directory: client-react
run: npm run test:coverage

- name: Upload React coverage
uses: actions/upload-artifact@v4
with:
name: react-coverage
path: client-react/coverage/

e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: server-go/go.sum

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: client-react/package-lock.json

- name: Install React dependencies
working-directory: client-react
run: npm ci

- name: Install Playwright browsers
working-directory: client-react
run: npx playwright install --with-deps chromium

- name: Start Go server
working-directory: server-go
run: go run ./cmd/server &
env:
ADDR: ':8081'

- name: Run E2E tests
working-directory: client-react
run: npx playwright test

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: client-react/playwright-report/
Loading
Loading