Skip to content

♻️ Change Mantle Block Explorer Links #622

♻️ Change Mantle Block Explorer Links

♻️ Change Mantle Block Explorer Links #622

name: 🕵️‍♂️ Test smart contracts
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
permissions:
contents: read
security-events: write
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
run_install: false
- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Restore pnpm cache
uses: actions/cache@v4
id: pnpm-cache
with:
path: ${{ steps.pnpm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install pnpm project with a clean slate
run: pnpm install --prefer-offline --frozen-lockfile
- name: Hardhat tests
run: pnpm test
- name: Slither static analyser
uses: crytic/slither-action@v0.4.0
id: slither
with:
node-version: ${{ matrix.node_version }}
fail-on: config
sarif: results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slither.outputs.sarif }}