-
-
Notifications
You must be signed in to change notification settings - Fork 849
113 lines (91 loc) · 3.94 KB
/
examples.yml
File metadata and controls
113 lines (91 loc) · 3.94 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
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
111
112
113
name: Test examples on trigger
on:
workflow_dispatch:
inputs:
npm_tag:
description: 'The npm tag for create razzle app'
default: 'development'
jest_filter:
description: 'The filter for jest tests'
default: 'simple'
package_manager:
description: 'The package manager to use, yalc with yarn default'
default: 'yalc'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
webpack: ["webpack@4.46.0 html-webpack-plugin@4.5.2" , "webpack@5.24.0 html-webpack-plugin@5.2.0"]
name: Test on node ${{ matrix.node-version }} and ${{ matrix.os }} with ${{ matrix.webpack }}
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
- name: Log date
run: echo "${{ steps.date.outputs.date }}"
- name: Set default run status
run: echo "::set-output name=last_run_status::default" > last_run_status
- name: Restore last run status
id: last_run
uses: actions/cache@v2
with:
path: |
last_run_status
key: ${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-${{ steps.date.outputs.date }}
restore-keys: |
${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-
- name: Set last run status
id: last_run_status
run: cat last_run_status
- name: Checkout ref
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_dispatch.ref }}
- name: Use Node.js ${{ matrix.node-version }}
if: steps.last_run_status.outputs.last_run_status != 'success'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install yalc globally
if: steps.last_run_status.outputs.last_run_status != 'success'
run: npm install -g yalc
- name: Install elm globally
if: steps.last_run_status.outputs.last_run_status != 'success'
run: yarn global add elm
- name: Restore lerna
if: steps.last_run_status.outputs.last_run_status != 'success'
id: cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-${{ hashFiles('**/yarn.lock') }}
- name: Install and bootstrap packages
if: steps.cache.outputs.cache-hit != 'true' && steps.last_run_status.outputs.last_run_status != 'success'
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 1000000
- name: Install ${{ matrix.webpack }}
if: steps.cache.outputs.cache-hit != 'true' && steps.last_run_status.outputs.last_run_status != 'success'
run: yarn add -WD ${{ matrix.webpack }} --ignore-engines --network-timeout 1000000
- name: Run tests
id: test_run
if: steps.last_run_status.outputs.last_run_status != 'success'
run: yarn test:examples -t ${{ github.event.inputs.jest_filter }} --runInBand
env:
WEBPACK_DEPS: "${{ matrix.webpack }}"
NPM_TAG: "${{ github.event.inputs.npm_tag }}"
PACKAGE_MANAGER: "${{ github.event.inputs.package_manager }}"
WARNINGS_ERRORS_DISABLE: true
- name: Upload test artifacts
uses: actions/upload-artifact@v2
if: ${{ always() && steps.last_run_status.outputs.last_run_status != 'success' }}
with:
name: ${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-${{ github.event.inputs.npm_tag }}-${{ github.event.inputs.jest_filter }}-${{ github.event.inputs.package_manager }}
path: test-artifacts/
- name: Save run status
if: steps.last_run_status.outputs.last_run_status != 'success'
run: echo "::set-output name=last_run_status::${{ steps.test_run.outcome }}" > last_run_status