-
Notifications
You must be signed in to change notification settings - Fork 24
87 lines (75 loc) · 3 KB
/
node.js.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
name: NodeJS CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# See https://nodejs.org/en/about/releases/
node-version: [20.x]
env:
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install and lint
run: |
npm install
npm link
npm run lint
sol-ast-compile --version
# See https://github.com/ethereum/solc-bin
# See https://binaries.soliditylang.org/
# Also, remove list files and one rarely used compiler to still test downloading on-demand.
- name: Pre-download compilers from historical builds archive
run: |
sol-ast-compile --download-compilers native wasm
find $SOL_AST_COMPILER_CACHE -name 'list.json' -delete
find $SOL_AST_COMPILER_CACHE -name '*v0.5.17*' -delete
- name: Test and generate coverage report
run: npm test
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v4
with:
name: codecov-umbrella
directory: ./coverage/
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
notify-slack:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- id: non_merge_commit_message
run: echo "commit_message=$(git log --pretty=format:'%s' --no-merges -n 1)" >> $GITHUB_OUTPUT
shell: bash
- name: Send slack Notification
uses: slackapi/slack-github-action@v1.23.0
with:
payload: |
{
"project": "${{ github.repository }}",
"env": "master",
"version": "",
"actor": "${{ github.triggering_actor }}",
"commit_sha": "${{ github.sha }}",
"commit_message": "${{ steps.non_merge_commit_message.outputs.commit_message }}",
"commit_link": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}",
"message": ""
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}