|
1 | 1 | name: NodeJS CI |
2 | 2 |
|
3 | 3 | 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" ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build: |
11 | | - runs-on: ubuntu-latest |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
12 | 12 |
|
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 ] |
17 | 17 |
|
| 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 | + } |
18 | 84 | 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 }} |
0 commit comments