-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.74 KB
/
testing.yml
File metadata and controls
82 lines (67 loc) · 2.74 KB
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Testing Yari
on:
push:
branches: [master]
pull_request:
branches:
- master
# These line is temporary! At least until we're done using Gregor's
# reductio-reloaded branch instead of mdn.
- reductio-reloaded
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git_diff_kumascript
with:
PREFIX_FILTER: |
kumascript/
- name: Display Git diffs
run: echo ${{ steps.git_diff_kumascript.outputs.diff }}
- name: Setup Node.js environment
uses: actions/setup-node@v2-beta
with:
node-version: "12"
- name: Display Node & Yarn version
run: |
node --version
yarn --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install all yarn packages
run: |
./testing/scripts/yarn-install.sh
./testing/scripts/yarn-lockfile-check.sh
- name: Lint checking
run: ./testing/scripts/lint-check.sh
- name: Unit testing client
run: yarn workspace client run test
- name: Unit testing kumascript
run: yarn workspace kumascript run test
if: steps.git_diff_kumascript.outputs.diff
- name: Functional testing
run: |
# Make this env var explicit for GitHub Actions because in local
# dev/debug you're encouraged to start it yourself in a separate
# terminal.
export TESTING_START_SERVER=true
# In terms of the --maxWorkers option, it's not yet clear which
# is best.
# See https://jestjs.io/docs/en/troubleshooting#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
# and https://www.peterbe.com/plog/ideal-number-of-workers-in-jest-maxWorkers
# CI tends to have fewer CPUs than laptops so let's stay conservative
# for now.
# Also note that `--runInBand` is the same as `--maxWorkers=1`
./testing/scripts/functional-test.sh --runInBand