-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.45 KB
/
build-run-test.yaml
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
name: Build and Run Tests
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
# TODO - Optimize. Build images only once.
# For example, webapp-next is built 3 times now:
# In build job and once for each backend when testing e2e
build:
runs-on: ubuntu-latest
strategy:
matrix:
service:
[
backend-golang-rest,
backend-js-rest,
webapp-golang-htmx,
webapp-nextjs,
e2e-cypress,
]
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t ${{ matrix.service }} ${{ matrix.service }}
e2e:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
e2e_runner: [cypress]
frontend: [next, golang-htmx]
backend: [go, js]
db: [inmemory, mongo]
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: KengoTODA/actions-setup-docker-compose@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "${{ secrets.DOT_ENV }}" > .env
- name: Run E2E tests
run: just test-${{ matrix.e2e_runner }}-${{ matrix.frontend }}-${{ matrix.backend }}-${{ matrix.db }}
- name: Upload test screenshots
uses: actions/upload-artifact@v2
with:
name: e2e-screenshots-${{ matrix.e2e_runner }}-${{ matrix.frontend }}-${{ matrix.backend }}
path: cypress/screenshots