-
Notifications
You must be signed in to change notification settings - Fork 2
185 lines (168 loc) · 4.65 KB
/
Copy pathci.yml
File metadata and controls
185 lines (168 loc) · 4.65 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: ci
on:
push:
paths-ignore:
- "docs/**"
- "*.md"
branches:
- 'main'
- 'dev'
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
branches:
- 'main'
- 'dev'
permissions:
id-token: write
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [lts/*,latest]
pnpm: [latest]
include:
- node: latest
pnpm: latest
coverage: true
lint: true
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm ${{ matrix.pnpm }}
uses: pnpm/action-setup@v6
with:
version: ${{ matrix.pnpm }}
run_install: false
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Prepare
run: pnpm run dev:prepare
- name: Lint
if: matrix.lint
run: pnpm run lint
- name: Build module
run: pnpm run dev:build
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Module only type tests
run: pnpm run test:types
env:
CI: true
- name: Unit tests
run: |
mkdir -p coverage
if [ "$COVERAGE" = '1' ]; then
pnpm run test:coverage
else
pnpm run test
fi
env:
CI: true
- name: Upload test artifacts
if: matrix.coverage
uses: actions/upload-artifact@v6
with:
name: vitest-logs-unit${{ matrix.node }}
path: ./coverage
if-no-files-found: error
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v6
with:
name: vitest-node-${{ matrix.node }}
flags: vitest
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
- name: Audit
run: pnpm audit
deploy-next:
runs-on: ubuntu-latest
needs: [test]
if: |
github.ref == 'refs/heads/dev' &&
github.event_name == 'push' &&
github.repository_owner == 'components-web-app' &&
!contains(github.event.head_commit.message, '[skip-release]') &&
!startsWith(github.event.head_commit.message, 'docs')
strategy:
matrix:
pnpm: [ latest ]
node: [ latest ]
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Setup pnpm ${{ matrix.pnpm }}
uses: pnpm/action-setup@v6
with:
version: ${{ matrix.pnpm }}
run_install: false
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- run: pnpm install
- run: pnpm dev:prepare
- run: pnpm build
- name: Release Edge
run: ./scripts/release-edge.sh ${{ github.ref == 'refs/heads/dev' && 'latest' || '1x' }}
env:
NPM_CONFIG_PROVENANCE: true
# e2e:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node: [16]
# fail-fast: true
# container: cypress/included:10.11.0
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install SASS dependencies
# run: |
# apt-get update
# apt-get install -y g++ build-essential
# - name: Use Node.js ${{ matrix.node }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# - name: Cache Node.js modules
# uses: actions/cache@v3
# with:
# path: ~/.yarn
# key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.OS }}-node-
# ${{ runner.OS }}-
# - name: Install dependencies
# run: yarn --frozen-lockfile
# - name: Start API, Build and Start Demo Application
# env:
# API_PORT: 3100
# API_URL: http://localhost:3100
# NODE_TLS_REJECT_UNAUTHORIZED: 0
# DISABLE_HTTPS: true
# TESTING: true
# run: |
# yarn api &
# yarn run demo:build
# yarn run demo:start &
# npx wait-on 'http://localhost:3000'
# curl -XGET localhost:3000
# - name: Run E2E
# env:
# CYPRESS_BASE_URL: http://localhost:3000
# run: yarn e2e --record --key=${{secrets.CYPRESS_RECORD_KEY}}