ci: add workflow to run Slither on Pull Requests #635
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, cache/restore them, build the contract abis + JSON interfaces and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI - Build + Test | |
on: | |
push: | |
branches: | |
- "develop" | |
pull_request: | |
branches: ["*"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: implementations | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js v20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
cache: "npm" | |
cache-dependency-path: implementations/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run Solidity Linter | |
run: npm run lint:solidity | |
- name: Run ESLint on JS/TS files | |
run: npm run lint | |
- name: Compile contracts | |
run: npm run build --if-present | |
- name: Run Tests (with coverage) | |
run: npm run test:coverage | |
- name: Upload to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
path-to-lcov: ./implementations/coverage/lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# TODO: fix authentication token to enable auto-comment in PRs opened from forks | |
# - name: Code coverage report | |
# uses: romeovs/[email protected] | |
# with: | |
# lcov-file: ./implementations/coverage/lcov.info | |
# github-token: ${{ secrets.LUKSO_DEVOPS_TOKEN }} | |
# title: 📊 Solidity code coverage | |
# filter-changed-files: true | |
# delete-old-comments: true |