forked from Azure/static-web-apps-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (102 loc) · 3.05 KB
/
node.yml
File metadata and controls
116 lines (102 loc) · 3.05 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
114
115
116
# 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: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
npm ci
npm test
test-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
npm ci
npm test -- --maxWorkers=1
test-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
npm ci
npm test
# TODO: Cypress setup is failing on CI. Investigate.
# e2e:
# needs: [test-macos, test-windows, test-linux]
# runs-on: ${{ matrix.os }}
# strategy:
# # when one test fails, DO NOT cancel the other
# # containers, because this will kill Cypress processes
# # https://github.com/cypress-io/github-action/issues/48
# fail-fast: false
# matrix:
# os: [macos-latest, windows-latest, ubuntu-20.04]
# node-version: [14.x]
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# record: false
# start: npm run e2e:static
# browser: chrome
# headless: true
# wait-on: "http://0.0.0.0:1234, http://localhost:7071"
# wait-on-timeout: 120
# env:
# DEBUG: "cypress:*"
# - uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: cypress-screenshots
# path: cypress/screenshots
package:
needs: [test-macos, test-windows, test-linux]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v2
with:
name: static-web-apps-cli
path: "*.tgz"