-
Notifications
You must be signed in to change notification settings - Fork 23
48 lines (45 loc) · 1.35 KB
/
separate-jobs.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: separate
on: [push]
# this workflow has two jobs
# 1. the "install-job" installs everything and saves the build
# web application as an upload artifact
# 2. the "test-job" downloads the build site and runs tests
jobs:
install-job:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
# only install the dependencies without running any tests
- name: Cypress run
uses: cypress-io/github-action@v2
with:
runTests: false
- run: npm run build
# only upload the local folders we built / updated
# ./public
# TIP: we want to avoid uploading node_modules since it is SLOW
# https://glebbahmutov.com/blog/parallel-cypress-tests-gh-action/
- name: Save built folders 🆙
uses: actions/upload-artifact@v2
with:
name: built
path: |
public
test-job:
runs-on: ubuntu-20.04
needs: install-job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download built folders ⏬
uses: actions/download-artifact@v2
with:
name: built
# install dependencies and run the tests
- name: Cypress run
uses: cypress-io/github-action@v2
with:
command: npm run expect -- --env lastName=Smith
env:
CYPRESS_firstName: Joe