-
-
Notifications
You must be signed in to change notification settings - Fork 363
134 lines (116 loc) · 3.32 KB
/
build.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: unit-tests
on:
pull_request:
branches:
- 'dev*'
- 'releases/v*'
push:
branches:
- 'dev*'
tags-ignore:
- '*.*'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'v20.10.0'
registry-url: 'https://registry.npmjs.org'
- name: Install Yarn
run: npm install -g yarn
- name: Install and Test
run: |
yarn install --frozen-lockfile
yarn lint:check
yarn lint:format:check
yarn test
- name: Uploade CodeCov Report
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'v20.10.0'
registry-url: 'https://registry.npmjs.org'
- name: Install Yarn
run: npm install -g yarn
- name: Build lib
run: |
yarn install --frozen-lockfile
yarn build
- name: Rebuild production node_modules
run: |
yarn install --production --frozen-lockfile
ls node_modules
- name: artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: |
lib
node_modules
integration:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
branch: ['gh-pages', 'no-pages']
commit: ['singleCommit', 'add commits']
max-parallel: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 'v20.10.0'
registry-url: 'https://registry.npmjs.org'
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
- name: Deploy
id: unmodified
uses: ./
with:
folder: integration
branch: ${{ matrix.branch }}
single-commit: ${{ matrix.commit == 'singleCommit' }}
dry-run: true
# Usually, this should be skipped, but if the upstream gh-pages
# branch doesn't match ours, it should still be a success.
- name: Check step output
run: |
[[ \
${{steps.unmodified.outputs.deployment-status}} = skipped || \
${{steps.unmodified.outputs.deployment-status}} = success \
]]
- name: Tweak content to publish to existing branch
if: ${{ matrix.branch == 'gh-pages' }}
run: |
echo "<!-- just sayin -->" >> integration/index.html
- name: Deploy with modifications to existing branch
id: modified
uses: ./
if: ${{ matrix.branch == 'gh-pages' }}
with:
folder: integration
branch: ${{ matrix.branch }}
single-commit: ${{ matrix.commit == 'singleCommit' }}
dry-run: true
# The modified deployment should be a success, and not skipped.
- name: Check step output
if: ${{ matrix.branch == 'gh-pages' }}
run: |
[[ \
${{steps.modified.outputs.deployment-status}} = success \
]]