forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (75 loc) · 2.78 KB
/
e2e.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
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
86
87
name: Cypress E2E tests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
cypress-run:
if: github.repository == 'redwoodjs/redwood'
strategy:
matrix:
os: ['ubuntu-latest']
node-version: ['14', '16']
fail-fast: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} | Node ${{ matrix.node-version }} latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# For network flakiness. See https://github.com/vercel/next.js/pull/28264
- name: Tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Create a temporary directory
id: createpath
run: |
project_path=$(mktemp -d -t redwood.XXXXXX)
echo "::set-output name=project_path::$project_path"
framework_path=$(pwd)
echo "::set-output name=framework_path::$framework_path"
- name: Create a RedwoodJS app
run: ./tasks/run-e2e ${{ steps.createpath.outputs.project_path }} --no-start
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Init Git for RedwoodJS app directory
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git init --initial-branch main && git add .
git commit -a --message=init
working-directory: ${{ steps.createpath.outputs.project_path }}
- name: Start server in background
run: yarn rw dev --no-generate --fwd="--no-open" &
working-directory: ${{ steps.createpath.outputs.project_path }}
- name: Cypress run
uses: cypress-io/github-action@v2
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RW_PATH: "${{ steps.createpath.outputs.project_path }}"
with:
# we've already installed dependencies
install: false
env: true
browser: chrome
record: false
wait-on: 'http://localhost:8910'
working-directory: ./tasks/e2e
spec: |
cypress/integration/01-tutorial/*.spec.js
cypress/integration/04-logger/*.spec.js