-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.28 KB
/
e2e-tests.yml
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
name: E2E tests
on:
push:
branches:
- master
tags:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: hitobito/development
path: development
- uses: actions/checkout@v2
with:
repository: hitobito/hitobito
path: development/app/hitobito
- uses: actions/checkout@v2
with:
repository: hitobito/hitobito_youth
path: development/app/hitobito_youth
- uses: actions/checkout@v2
with:
repository: hitobito/hitobito_pbs
path: development/app/hitobito_pbs
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pull images
run: docker-compose pull --include-deps --quiet rails worker
continue-on-error: true
- name: Create Cache Volumes
run: |
docker volume create hitobito_bundle
docker volume create hitobito_yarn_cache
- name: Start hitobito
run: |
export RAILS_UID=$(id -u)
docker-compose up -d rails worker
- name: Run cypress
uses: cypress-io/github-action@v2
with:
wait-on: 'http://localhost:3000'
wait-on-timeout: 600
record: true
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Stop hitobito
if: always()
run: docker-compose down
# after the test run completes
# store videos and any screenshots
# NOTE: screenshots will be generated only if E2E test failed
# thus we store screenshots only on failures
# Alternative: create and commit an empty cypress/screenshots folder
# to always have something to upload
- name: Upload screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: Screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: Upload videos
uses: actions/upload-artifact@v2
if: always()
with:
name: Videos
path: cypress/videos