fix(subgraph): use hosted service for avalanche #175
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
name: CI | |
permissions: | |
id-token: write | |
contents: write # Checkout | |
security-events: write # Upload Sarif | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Slither | |
run: | | |
pip install slither-analyzer | |
slither --version | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Build | |
run: pnpm -C packages/hardhat build | |
- name: Lint | |
run: pnpm lint | |
- name: Test | |
run: pnpm -filter '!@sifi/hardhat' packages/frontend test | |
- name: Foundry forge build | |
run: pnpm -C packages/hardhat forge-build | |
- name: Slither analyze | |
id: slither | |
continue-on-error: true | |
run: pnpm -C packages/hardhat slither:ci | |
- name: Check slither SARIF output existence | |
# Slither findings are treated as error, so we need to | |
# ckeck manually for sucesss by existence of SARIF file | |
id: check_files | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: 'packages/hardhat/results.sarif' | |
- name: Upload Slither SARIF file | |
# Only upload the SARIF file if the repository is sideshiftfi/sifi | |
# since this cannot be run in private repos | |
if: | | |
github.repository == 'sideshiftfi/sifi' && | |
steps.check_files.outputs.files_exists == 'true' | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: packages/hardhat/results.sarif |