-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 1.95 KB
/
nodejs.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
name: Node CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
build:
strategy:
matrix:
node-version: ['20.x', '22.x']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: corepack enable && corepack prepare yarn@stable --activate && yarn install --immutable
- name: Build
run: yarn build
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'push' && matrix.node-version == '20.x' }}
with:
name: deployment
path: dist/*
test:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: corepack enable && corepack prepare yarn@stable --activate && yarn install --immutable
- name: Lint
run: yarn lint
- name: Unit Test
run: yarn test:unit --ci --maxWorkers=2
- name: E2E Test
run: yarn test:e2e --headless
- uses: actions/upload-artifact@v4
if: ${{ matrix.node-version == '20.x' }}
with:
name: test-videos
path: test/e2e/videos/*
- uses: codecov/codecov-action@v4
if: ${{ matrix.node-version == '20.x' }}
publish:
runs-on: ubuntu-22.04
needs: build
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/download-artifact@v4
with:
name: deployment
path: ./dist
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist