Skip to content

Commit

Permalink
Use NodeJS v20 (LTS) (#249)
Browse files Browse the repository at this point in the history
* Removed Mocha and nyc dependencies alongside with related config files. Introduced jest and adapted tests. Updated typescript to latest (with some other development dependencies).

* Reduce line coverage threshold by 1% due to coverage tool differences

* Add "text" coverage reporter

* Use NodeJS v20 (LTS)

* Update checkout and setup-node GitHub actions versions to newer

---------

Co-authored-by: Dimitar Bounov <[email protected]>
  • Loading branch information
blitz-1306 and cd1m0 authored Jan 18, 2024
1 parent b7c0527 commit 6b3cb72
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 77 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
uses: actions/checkout@v4 # If you're using actions/checkout since v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: Install SSH Client 🔑
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Install and build the documentation🔧
run: |
Expand Down
140 changes: 70 additions & 70 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
name: NodeJS CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
push:
branches: ["master"]
pull_request:
branches: ["master"]

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

strategy:
matrix:
# See https://nodejs.org/en/about/releases/
node-version: [ 16.x ]
strategy:
matrix:
# See https://nodejs.org/en/about/releases/
node-version: [20.x]

env:
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache
env:
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache

steps:
- name: Checkout
uses: actions/checkout@v3
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- 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
- 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
# 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: Test and generate coverage report
run: npm test

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3
with:
name: codecov-umbrella
directory: ./coverage/
fail_ci_if_error: true
verbose: true
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3
with:
name: codecov-umbrella
directory: ./coverage/
fail_ci_if_error: true
verbose: true

notify-slack:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
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/[email protected]
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 }}
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/[email protected]
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 }}
6 changes: 3 additions & 3 deletions .github/workflows/npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm publish
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14.0
20.11.0

0 comments on commit 6b3cb72

Please sign in to comment.