54 lines (51 loc) · 1.77 KB
/
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
name: Run Tests
on: [push]
jobs:
release:
name: Run
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node-version }}
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v2.1.0
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn && yarn lerna bootstrap
- name: Create new App
id: create-app
# Sets outputs.appPath to the created directory
run: node ./packages/create-bison-app/scripts/createApp foo --acceptDefaults
- name: Check Build Command
run: |
cd ${{steps.create-app.outputs.appPath}}
yarn build
- name: Run Unit Tests
run: yarn test
- name: Run Cypress E2E Tests
uses: cypress-io/github-action@v2
with:
start: node ./packages/create-bison-app/scripts/startServer ${{steps.create-app.outputs.appPath}} 3001
wait-on: "http://localhost:3001"
wait-on-timeout: 180
project: ./packages/create-bison-app
spec: ./packages/create-bison-app/cypress/integration/createBisonAppWithDefaults.test.js
env:
NODE_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_PATH: ${{steps.create-app.outputs.appPath}}
APP_NAME: ${{steps.create-app.outputs.appName}}