-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.77 KB
/
main.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
name: Cypress Tests
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: 🏧 Checkout
uses: actions/checkout@v2
- name: 📥 Download bootstrap inventory
run: wget https://github.com/accosine/tabloid/releases/download/v0.0.0-experimental/bootstrap.tar.gz
- name: 📤 Extract bootstrap inventory
run: tar -zxvf bootstrap.tar.gz bootstrap/inventory
- name: 📝 Setup Docker environment variables
run: cp .env.example .env
- name: 📝 Setup Prisma environment variables
run: cp .env.example .env
working-directory: newspaper
- name: 🐳 Run docker-compose
# run web stack in the background via docker-compose
# check docker-compose.ci.yml file for reference
run: docker-compose -f docker-compose.ci.yml up -d
- name: 🧪 Cypress run
# Install NPM dependencies and run all Cypress tests
uses: cypress-io/github-action@v2
with:
wait-on: "http://localhost:3001"
wait-on-timeout: 120
start: npm run ci
working-directory: e2e
config: pageLoadTimeout=100000,baseUrl=http://localhost:3001
- uses: actions/upload-artifact@v2
# after the test run completes
# store videos and any screenshots
# NOTE: screenshots will be generated only if an E2E test failed
# thus we store screenshots only on failures
if: failure()
with:
name: cypress-screenshots
path: e2e/cypress/screenshots
- uses: actions/upload-artifact@v2
# Test run video was always captured, so this action uses "always()" condition
if: always()
with:
name: cypress-videos
path: e2e/cypress/videos