Skip to content

Commit

Permalink
fix: cleanup ci (#47)
Browse files Browse the repository at this point in the history
* fix: cleanup ci

* fix: test assume not proxyADmin
  • Loading branch information
sakulstra authored Nov 14, 2024
1 parent a1eb1d8 commit 712a88d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@ jobs:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}

# we simply use foundry zk for all jobs in this repo
- name: Install Foundry zksync
uses: bgd-labs/foundry-zksync-toolchain@340cea9a42119d9a77a6bb0a8236d4311582b709
- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@main
with:
version: nightly

- name: Run Forge build
run: |
forge --version | sed -r 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' | tee /tmp/foundry_version ; test ${PIPESTATUS[0]} -eq 0
forge cache ls
${{ inputs.zksync && 'FOUNDRY_PROFILE=zksync' || '' }} forge build --sizes ${{ inputs.zksync && '--zksync' || ''}} | sed -r 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' | tee /tmp/foundry_build ; test ${PIPESTATUS[0]} -eq 0
id: build
ZKSYNC: 'true'

- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/foundry-test@main
Expand All @@ -44,15 +37,6 @@ jobs:
with:
ZKSYNC: true

- name: Create comment body
id: get-comment-body
run: |
mkdir -p /tmp/content
printf "Foundry report\n\n" > /tmp/content/content.txt
printf "\`\`\`shell\n$(cat /tmp/foundry_version)\n\`\`\`\n\n" >> /tmp/content/content.txt
printf "<details><summary>Build log</summary>\n\n\`\`\`shell\n$(cat /tmp/foundry_build)\n\`\`\`\n</details>\n\n" >> /tmp/content/content.txt
printf "<details><summary>Test ${{ env.testStatus == 0 && 'success :rainbow:' || 'error :finnadie::x:'}}</summary>\n\n\`\`\`shell\n$(cat /tmp/foundry_test)\n\`\`\`\n</details>\n\n" >> /tmp/content/content.txt
- name: Run Gas report
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@main

Expand Down
6 changes: 3 additions & 3 deletions zksync/test/TransparentProxyFactoryZkSync.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract TestTransparentProxyFactoryZkSync is Test {

function testCreateDeterministic(address admin, bytes32 salt) public {
// we know that this is covered at the ERC1967Upgrade
vm.assume(admin != address(0));
vm.assume(admin != address(0) && admin != address(this));

uint256 FOO = 2;
bytes memory data = abi.encodeWithSelector(mockImpl.initialize.selector, FOO);
Expand Down Expand Up @@ -81,7 +81,7 @@ contract TestTransparentProxyFactoryZkSync is Test {
bytes32 proxyAdminSalt
) public {
// we know that this is covered at the ProxyAdmin contract
vm.assume(proxyAdminOwner != address(0));
vm.assume(proxyAdminOwner != address(0) && proxyAdminOwner != address(this));

address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);

Expand All @@ -96,7 +96,7 @@ contract TestTransparentProxyFactoryZkSync is Test {

function testCreateProxyAdmin(address proxyAdminOwner, bytes32 proxyAdminSalt) public {
// we know that this is covered at the ProxyAdmin contract
vm.assume(proxyAdminOwner != address(0));
vm.assume(proxyAdminOwner != address(0) && proxyAdminOwner != address(this));

address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);
assertTrue(proxyAdmin.code.length != 0);
Expand Down

0 comments on commit 712a88d

Please sign in to comment.