forked from sifiorg/sifi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: separate out ci requiring secrets
- Loading branch information
Showing
2 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
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 | ||
|
||
- 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: Test hardhat | ||
env: | ||
RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | ||
run: pnpm -C packages/hardhat test | ||
|
||
- name: Foundry forge test | ||
run: pnpm -C packages/hardhat forge-test |
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