-
Notifications
You must be signed in to change notification settings - Fork 2.1k
110 lines (107 loc) · 3.39 KB
/
test.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: MDC Test
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
!packages/*/node_modules/@material
key: ${{ runner.os }}-lerna-${{ hashFiles('package-lock.json', 'packages/**/package.json') }}
- run: npm ci --ignore-scripts
- run: npm run bootstrap
conventional-commit-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-test:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
!packages/*/node_modules/@material
key: ${{ runner.os }}-lerna-${{ hashFiles('package-lock.json', 'packages/**/package.json') }}
- run: npm run link
- run: |
npm run dist
node scripts/cp-pkgs.js
node scripts/verify-pkg-main.js
unit-test:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
!packages/*/node_modules/@material
key: ${{ runner.os }}-lerna-${{ hashFiles('package-lock.json', 'packages/**/package.json') }}
- run: npm run link
- name: Run unit tests
run: |
# Unit tests does not run on forked repositories because GitHub
# secrets (that includes Sauce access info) are not shared.
if [[ -z "$SAUCE_USERNAME$SAUCE_ACCESS_KEY" ]]; then
echo "Unit tests do not run on forked repos because of Sauce labs access. Run 'npm run test:unit' manually to verify."
exit 1
else
export SAUCE_BUILD_ID=mdc-tests-${GITHUB_EVENT_NAME}-${GITHUB_ACTION}-${GITHUB_SHA}
export SAUCE_TUNNEL_ID=${SAUCE_BUILD_ID}-tunnel
npm run test:unit
fi
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
dependency-test:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
!packages/*/node_modules/@material
key: ${{ runner.os }}-lerna-${{ hashFiles('package-lock.json', 'packages/**/package.json') }}
- run: npm run link
- name: Run dependency tests
run: |
npm run test:dependency