Skip to content

Commit

Permalink
ci: report relevant changes from foundry artifacts (#44)
Browse files Browse the repository at this point in the history
* ci: report relevant changes from foundry artifacts

* fix: skip if no base

* fix: test

* fix: file name

* fix: omg

* fml

* fix: add jest config

* fix: test action

* test: add useless test to diff

* fix: add very minimal parser

* fix: test gas diff

* fix: update to shanghai

* fix: update test

* fix: remove lcov info

* fix: update action

* fix: update evm on zksync

* empty

* empty
  • Loading branch information
sakulstra authored Nov 12, 2024
1 parent a842c36 commit 4b7ecc2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
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

0 comments on commit 4b7ecc2

Please sign in to comment.