Skip to content

Commit 0176c0e

Browse files
ci: notify new changes on develop and master
1 parent d397fc8 commit 0176c0e

2 files changed

Lines changed: 78 additions & 49 deletions

File tree

.github/workflows/node.js.yaml

Lines changed: 77 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,85 @@
11
name: NodeJS CI
22

33
on:
4-
push:
5-
branches: ["master", "develop"]
6-
pull_request:
7-
branches: ["master", "develop"]
4+
push:
5+
branches: [ "master", "develop" ]
6+
pull_request:
7+
branches: [ "master", "develop" ]
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
10+
build:
11+
runs-on: ubuntu-latest
1212

13-
strategy:
14-
matrix:
15-
# See https://nodejs.org/en/about/releases/
16-
node-version: [16.x]
13+
strategy:
14+
matrix:
15+
# See https://nodejs.org/en/about/releases/
16+
node-version: [ 16.x ]
1717

18+
env:
19+
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Use NodeJS ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: "npm"
30+
31+
- name: Install and lint
32+
run: |
33+
npm install
34+
npm link
35+
npm run lint
36+
37+
# See https://github.com/ethereum/solc-bin
38+
# See https://binaries.soliditylang.org/
39+
# Also, remove list files and one rarely used compiler to still test downloading on-demand.
40+
- name: Pre-download compilers from historical builds archive
41+
run: |
42+
scribble --download-compilers native wasm
43+
find $SOL_AST_COMPILER_CACHE -name 'list.json' -delete
44+
find $SOL_AST_COMPILER_CACHE -name '*v0.5.17*' -delete
45+
46+
- name: Test and generate coverage report
47+
run: |
48+
npm run test:ci
49+
npm run coverage
50+
51+
- name: Upload coverage to CodeCov
52+
uses: codecov/codecov-action@v3
53+
with:
54+
name: codecov-umbrella
55+
directory: ./coverage/
56+
fail_ci_if_error: true
57+
verbose: true
58+
59+
notify-slack:
60+
needs: build
61+
runs-on: ubuntu-latest
62+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
63+
steps:
64+
- uses: actions/checkout@v3
65+
with:
66+
ref: ${{ github.event.pull_request.head.sha }}
67+
- id: non_merge_commit_message
68+
run: echo "commit_message=$(git log --pretty=format:'%s' --no-merges -n 1)" >> $GITHUB_OUTPUT
69+
shell: bash
70+
- name: Send slack Notification
71+
uses: slackapi/slack-github-action@v1.23.0
72+
with:
73+
payload: |
74+
{
75+
"project": "${{ github.repository }}",
76+
"env": "${{ github.ref_name }}",
77+
"version": "",
78+
"actor": "${{ github.triggering_actor }}",
79+
"commit_sha": "${{ github.sha }}",
80+
"commit_message": "${{ steps.non_merge_commit_message.outputs.commit_message }}",
81+
"commit_link": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}",
82+
"message": ""
83+
}
1884
env:
19-
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache
20-
21-
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v3
24-
25-
- name: Use NodeJS ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
cache: "npm"
30-
31-
- name: Install and lint
32-
run: |
33-
npm install
34-
npm link
35-
npm run lint
36-
37-
# See https://github.com/ethereum/solc-bin
38-
# See https://binaries.soliditylang.org/
39-
# Also, remove list files and one rarely used compiler to still test downloading on-demand.
40-
- name: Pre-download compilers from historical builds archive
41-
run: |
42-
scribble --download-compilers native wasm
43-
find $SOL_AST_COMPILER_CACHE -name 'list.json' -delete
44-
find $SOL_AST_COMPILER_CACHE -name '*v0.5.17*' -delete
45-
46-
- name: Test and generate coverage report
47-
run: |
48-
npm run test:ci
49-
npm run coverage
50-
51-
- name: Upload coverage to CodeCov
52-
uses: codecov/codecov-action@v3
53-
with:
54-
name: codecov-umbrella
55-
directory: ./coverage/
56-
fail_ci_if_error: true
57-
verbose: true
85+
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ src/rewriter/import_directive_parser.ts
1010
.vscode/launch.json
1111
test/multifile_samples/*/__scribble_ReentrancyUtils.sol
1212
test/multifile_samples/*/*.sol.instrumented
13+
.idea

0 commit comments

Comments
 (0)