-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (75 loc) · 2.52 KB
/
Copy pathtest.yml
File metadata and controls
85 lines (75 loc) · 2.52 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test
run-name: Test run triggered by @${{ github.actor }}
on:
workflow_call:
inputs:
environment:
description: What environment should the app be deployed to?
required: true
default: 'development'
type: string
secrets:
DEPLOY_DOCKER_REPOSITORY:
required: true
DEPLOY_AWS_ACCESS_KEY_ID:
required: true
DEPLOY_AWS_SECRET_ACCESS_KEY:
required: true
jobs:
test:
runs-on: ubuntu-latest
environment: development
env:
DOCKER_REPO: ${{ secrets.DEPLOY_DOCKER_REPOSITORY }}
TESTCONTAINERS_REUSE_ENABLE: true
steps:
- uses: actions/checkout@v4
- name: Install AWS CLI
uses: ./.github/actions/awscli-setup
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.22.3'
cache: 'npm'
- name: Install node dependencies
run: npm ci
- id: lint
name: Lint
run: npm run lint
- name: Test documentation generates without errors
run: npm run generate:docs
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- uses: aws-actions/amazon-ecr-login@v2
- id: run-with-docker-compose
run: docker compose --progress quiet -f docker-compose-real-backend.yml up -d
- id: docker-compose-ps
name: Check docker compose output
run: |
sleep 30
docker compose --progress quiet -f docker-compose-real-backend.yml ps
curl -v http://localhost:8085/
- name: Run unit tests
run: npm run test:unit
- uses: ./.github/actions/playwright-setup
- name: Run integration tests
run: npm run test:integration
- name: Run acceptance tests
run: npm run test:acceptance:ci
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- id: docker-compose-logs
if: always()
run: |
docker compose --progress quiet -f docker-compose-real-backend.yml logs --tail frontend
docker compose --progress quiet -f docker-compose-real-backend.yml logs --tail request-api
- id: stop-containers
if: always()
run: docker compose --progress quiet -f docker-compose-real-backend.yml down