-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (102 loc) · 2.9 KB
/
tests.yaml
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
name: Run Tests
on:
pull_request: {}
push:
branches:
- master
schedule:
- cron: '0 0 * * 0' # 0:00 UTC on every sunday
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- run: npm ci
- run: npm run lint:ci
test:
name: Jest w/ react@${{ matrix.react.react-version }} @line/liff@${{ matrix.liff-sdk.sdk-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.liff-sdk.continue-on-error }}
strategy:
fail-fast: false
matrix:
react:
- react-version: 18
liff-sdk:
- sdk-version: '2.19'
continue-on-error: false
- sdk-version: '2.20'
continue-on-error: false
- sdk-version: '2.21'
continue-on-error: false
- sdk-version: '2.22'
continue-on-error: false
- sdk-version: latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- run: npm ci
- name: Reinstall specific version of react.js
run: |
npm i \
react@${{ matrix.react.react-version }} \
react-dom@${{ matrix.react.react-version }} \
@types/react@${{ matrix.react.react-version }}
- name: Reinstall specific version of @line/liff SDK
run: npm i @line/liff@${{ matrix.liff-sdk.sdk-version }}
- name: npm run test && report coverage
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: de17efec54641dd4eb561f1b0bdede12f7e310f921137eb3465771b63cbbe2f0
with:
coverageCommand: npm run test:ci
coverageLocations: |
${{ github.workspace }}/coverage/lcov.info:lcov
debug: true
- name: Reset local changes
run: git checkout . && npm ci
build:
needs: test
name: Build react-liff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- run: npm ci
- run: npm run build
- name: Upload the result of build react-liff
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
build-example-app:
needs: build
name: Build example app
runs-on: ubuntu-latest
defaults:
run:
working-directory: examples/simple
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- name: Download the result of build react-liff
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- run: npm i && npm run build