Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: report relevant changes from foundry artifacts #44

Merged
merged 18 commits into from
Nov 12, 2024
18 changes: 18 additions & 0 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR Comment

on:
workflow_run:
workflows: [Test]
types:
- completed

permissions:
actions: read
issues: write
checks: read
statuses: read
pull-requests: write

jobs:
comment:
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Head branch workflow
name: Test

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

on:
pull_request:
push:
branches:
- main

jobs:
test:
Expand All @@ -14,6 +17,6 @@ jobs:
uses: bgd-labs/github-workflows/.github/workflows/foundry-test.yml@main
secrets: inherit
with:
mode: "CHANGED"
mode: 'CHANGED'
zksync: true
ROOT_DIR: "zksync"
ROOT_DIR: 'zksync'
4 changes: 3 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tests = 'tests'
script = 'script'
out = 'out'
libs = ['lib']
evm_version = 'shanghai'
remappings = []

[profile.zksync]
Expand All @@ -12,6 +13,7 @@ test = 'zksync/test'
script = 'zksync/script'
libs = ['lib']
solc = '0.8.24'
evm_version = 'cancun'

[profile.zksync.zksync]
fallback_oz = true
Expand Down Expand Up @@ -57,7 +59,7 @@ fantom-testnet = { key = "${ETHERSCAN_API_KEY_FANTOM}", chain = 250 }
binance = { key = "${ETHERSCAN_API_KEY_BINANCE}", chain = 56 }
binance-testnet = { key = "${ETHERSCAN_API_KEY_BINANCE}", chain = 56 }
zksync = { key = "${ETHERSCAN_API_KEY_ZKSYNC}", chain = 324 }
zksync-testnet = { key = "${ETHERSCAN_API_KEY_ZKSYNC}", chain = 300, url = 'https://api-sepolia-era.zksync.network/api'}
zksync-testnet = { key = "${ETHERSCAN_API_KEY_ZKSYNC}", chain = 300, url = 'https://api-sepolia-era.zksync.network/api' }

[fuzz]
no_zksync_reserved_addresses = true
Expand Down
12 changes: 12 additions & 0 deletions test/ChainHelperTest.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import 'forge-std/Test.sol';
import {ChainHelpers} from '../src/contracts/utils/ChainHelpers.sol';

contract TestChainHelpers is Test {
function test_selectChain_shouldRevert() external {
vm.expectRevert();
ChainHelpers.selectChain(vm, 0);
}
}
2 changes: 1 addition & 1 deletion test/Rescuable721.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract Rescue721Test is Test {
}

function testFuzzEmergencyTokenTransfer(address recipient) public {
vm.assume(recipient != address(0));
vm.assume(recipient != address(0) && recipient != address(tokensReceiver));
testToken.mint(address(tokensReceiver), 1);

assertEq(testToken.balanceOf(address(tokensReceiver)), 1);
Expand Down
Loading