-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (83 loc) · 2.53 KB
/
check_pre-merge.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
name: pre-merge check
on:
push:
branches:
- master
- develop
- features/sprint*
pull_request:
branches:
- master
- develop
- features/sprint*
jobs:
logic-test:
name: validation logic test
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-22.04]
node: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
continue-on-error: true
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: setup-node retry
uses: actions/setup-node@v4
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: install_libusb
if: runner.os == 'Linux'
run: sudo apt install libusb-1.0-0-dev libudev-dev libusb-1.0-doc
- name: dump node version
id: node_ver
run: |
node_ver="$(node --version)"
echo "node_version=$node_ver" >> $GITHUB_OUTPUT
echo "node_version=$node_ver"
shell: bash
- name: node_modules-useCache
uses: actions/cache@v4
id: node_cache
with:
path: node_modules
key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
- name: npm info
if: steps.node_cache.outputs.cache-hit != 'true'
id: npm_info
run: |
npm --version
echo "npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT
shell: bash
- name: use npm cache
if: steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
- name: npm_install
if: steps.node_cache.outputs.cache-hit != 'true'
env:
CFDJS_UNUSE_ASSET: true
run: |
npm set progress=false
npm ci
- name: test
if: matrix.node == '16'
run: npm run test
- name: test node.js 18 or higher
if: matrix.node != '16'
run: NODE_OPTIONS=--no-experimental-fetch npm run test
shell: bash
- name: lint_check
if: runner.os == 'Linux'
run: npm run eslint_check