From 50b231f5837b93d8303d9d01b4fdacddeef9ddc4 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Tue, 26 Mar 2024 10:29:59 -0700 Subject: [PATCH 1/2] Update ci.yml --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb241ae7..47516584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,25 @@ name: CI + on: - workflow_dispatch: + workflow_dispatch: {} pull_request: push: branches: - master +defaults: + run: + shell: bash + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly @@ -28,86 +33,89 @@ jobs: if: always() run: | output=$(forge build --skip test) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi - name: Check compatibility with 0.8.0 + id: v0_8_0 if: always() run: | output=$(forge build --skip test --use solc:0.8.0) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi - name: Check compatibility with 0.7.6 + id: v0_7_6 if: always() run: | output=$(forge build --skip test --use solc:0.7.6) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi - name: Check compatibility with 0.7.0 + id: v0_7_0 if: always() run: | output=$(forge build --skip test --use solc:0.7.0) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi - name: Check compatibility with 0.6.12 + id: v0_6_12 if: always() run: | output=$(forge build --skip test --use solc:0.6.12) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi - name: Check compatibility with 0.6.2 + id: v0_6_2 if: always() run: | output=$(forge build --skip test --use solc:0.6.2) - if echo "$output" | grep -q "Warning"; then - echo "$output" + echo "$output" >> "$GITHUB_OUTPUT" exit 1 fi # via-ir compilation time checks. - name: Measure compilation time of Test with 0.8.17 --via-ir if: always() + id: ir_0_8_17 run: forge build --skip test --contracts test/compilation/CompilationTest.sol --use solc:0.8.17 --via-ir - name: Measure compilation time of TestBase with 0.8.17 --via-ir if: always() + id: ir_0_8_17_base run: forge build --skip test --contracts test/compilation/CompilationTestBase.sol --use solc:0.8.17 --via-ir - name: Measure compilation time of Script with 0.8.17 --via-ir if: always() + id: ir_0_8_17_script run: forge build --skip test --contracts test/compilation/CompilationScript.sol --use solc:0.8.17 --via-ir - name: Measure compilation time of ScriptBase with 0.8.17 --via-ir if: always() + id: ir_0_8_17_script_base run: forge build --skip test --contracts test/compilation/CompilationScriptBase.sol --use solc:0.8.17 --via-ir test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly @@ -120,10 +128,10 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly From b872f99597f857ba1096201fec4c4e3c7b459e73 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Wed, 27 Mar 2024 03:13:26 -0700 Subject: [PATCH 2/2] Update sync.yml --- .github/workflows/sync.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 5a9e9d59..19c45bed 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -8,14 +8,16 @@ on: jobs: sync-release-branch: runs-on: ubuntu-latest - if: startsWith(github.event.release.tag_name, 'v1') + if: ${{ github.repository_owner == 'foundry-rs' && startsWith(github.event.release.tag_name, 'v1') }} steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 ref: v1 + # the email is derived from the bots user id + # found here: https://api.github.com/users/github-actions%5Bbot%5D - name: Configure Git run: | git config user.name github-actions[bot]