tweak-action #123
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 (safe to test) | |
on: | |
push: | |
pull_request_target: | |
types: [labeled] | |
permissions: | |
id-token: write | |
contents: write # Checkout | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | |
if: | | |
github.event_name == 'push' || | |
contains(github.event.pull_request.labels.*.name, 'safe to test') || | |
(github.event_name == 'pull_request' && github.event.action != 'labeled') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- 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: Print Forge version | |
run: forge --version | |
- name: Build | |
run: pnpm -C packages/hardhat build | |
- name: Test hardhat | |
env: | |
RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | |
run: pnpm -C packages/hardhat hardhat-test | |
- name: Foundry forge test | |
env: | |
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | |
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }} | |
ARBITRUM_ONE_RPC_URL: ${{ secrets.ARBITRUM_ONE_RPC_URL }} | |
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | |
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }} | |
GOERLI_RPC_URL: ${{ secrets.GOERLI_RPC_URL }} | |
BSC_RPC_URL: ${{ secrets.BSC_RPC_URL }} | |
AVALANCHE_RPC_URL: ${{ secrets.AVALANCHE_RPC_URL }} | |
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | |
run: pnpm -C packages/hardhat forge-test |