-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.49 KB
/
test-and-lint.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
name: Test and Lint Check
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- alpha
- master
jobs:
test_and_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Create .env file
run: cp .env.example .env
- name: Install dependencies
run: |
npm install -g pnpm
pnpm install
for dir in packages/*/ packages/networks/*/; do
if [ -d "$dir" ] && [ "$(basename "$dir")" != "boilerplate" ]; then
cd "$dir" || exit
pnpm install
cd - || exit
fi
done
- name: Runt lint
run: npm run lint
- name: Run test
run: npm run coverage
- name: Code coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: MultipleChain/js
files: './coverage/clover.xml'
- name: Set PR status
if: ${{ github.event_name == 'pull_request' }}
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
STATUS_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
STATUS="{\"state\":\"success\",\"context\":\"Test Process\",\"description\":\"Test Process passed\"}"
curl -X POST -H "Authorization: token $TOKEN" -d "$STATUS" "$STATUS_URL"