Fix/weth market owner #3279
This file contains hidden or 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
| name: Multichain | |
| on: [pull_request] | |
| env: | |
| OP_RPC_URL: ${{secrets.OP_RPC_URL}} | |
| BASE_RPC_URL: ${{secrets.BASE_RPC_URL}} | |
| MOONBEAM_RPC_URL: ${{secrets.MOONBEAM_RPC_URL}} | |
| FOUNDRY_PROFILE: ci | |
| jobs: | |
| run-proposal-tests: | |
| name: Proposal Integration Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Run Integration Test | |
| uses: nick-fields/retry@v3 | |
| with: | |
| polling_interval_seconds: 30 | |
| timeout_minutes: 20 | |
| retry_wait_seconds: 60 | |
| max_attempts: 3 | |
| command: > | |
| time forge test --match-contract MultichainProposalTest | |
| --ffi -vvv | |
| run-cross-chain-tests: | |
| name: Cross Chain Publish Message Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Run Integration Test | |
| uses: nick-fields/retry@v3 | |
| with: | |
| polling_interval_seconds: 30 | |
| retry_wait_seconds: 60 | |
| timeout_minutes: 20 | |
| max_attempts: 3 | |
| command: time forge test --match-contract CrossChainPublishMessageTest -vvv --ffi | |
| run-live-proposals-integration-tests: | |
| name: Live Proposal Integration Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Run Integration Test | |
| uses: nick-fields/retry@v3 | |
| with: | |
| polling_interval_seconds: 30 | |
| timeout_minutes: 20 | |
| retry_wait_seconds: 60 | |
| max_attempts: 3 | |
| command: time forge test --mc LiveProposalsIntegrationTest -vvv --ffi | |
| run-on-chain-calldata-check: | |
| name: On Chain Calldata Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Get Changed Files | |
| id: files | |
| uses: jitterbit/get-changed-files@v1 | |
| with: | |
| format: "space-delimited" | |
| - name: Set PR_CHANGED_FILES | |
| run: | | |
| echo "PR_CHANGED_FILES=${{ steps.files.outputs.added_modified }}" >> $GITHUB_ENV | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Make the script executable | |
| run: chmod +x bin/run-onchain-calldata-check.sh | |
| - name: Run Test Proposal Calldata Generation | |
| run: bin/run-onchain-calldata-check.sh | |
| run-in-development-proposal: | |
| name: In Development Proposal | |
| permissions: | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: "recursive" | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Get Changed Files | |
| id: files | |
| uses: jitterbit/get-changed-files@v1 | |
| with: | |
| format: "space-delimited" | |
| - name: Set PR_CHANGED_FILES | |
| run: | | |
| echo "PR_CHANGED_FILES=${{ steps.files.outputs.added_modified }}" >> $GITHUB_ENV | |
| - name: Set DEBUG flag | |
| run: echo "DEBUG=true" >> $GITHUB_ENV | |
| - name: Set PROPOSALS_FOLDER | |
| run: echo "PROPOSALS_FOLDER=proposals/mips" >> $GITHUB_ENV | |
| - name: List and Delete Previous Comments | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| let withDevProposals; | |
| if (fs.existsSync('output.txt')) { | |
| const output = fs.readFileSync('output.txt', 'utf8'); | |
| withDevProposals = /\bPROPOSAL START\b/i.test(output); | |
| } | |
| const issue_number = context.payload.pull_request.number; | |
| const { data: allComments } = await github.rest.issues.listComments({ | |
| ...context.repo, | |
| issue_number: issue_number | |
| }); | |
| const botComments = allComments.filter(c => c.user && c.user.login === 'github-actions[bot]'); | |
| if (botComments.length === 0) { | |
| return; | |
| } | |
| // Preserve the latest bot comment if it contains 'Proposal Calldata' and there are no dev proposals in the output | |
| const latestBot = botComments[botComments.length - 1]; | |
| const keepId = latestBot && typeof latestBot.body === 'string' && latestBot.body.includes('Proposal Calldata') && !withDevProposals | |
| ? latestBot.id | |
| : null; | |
| for (const comment of botComments) { | |
| if (keepId && comment.id === keepId) { | |
| continue; | |
| } | |
| await github.rest.issues.deleteComment({ | |
| ...context.repo, | |
| comment_id: comment.id, | |
| }); | |
| } | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Run Calldata Printing | |
| uses: nick-fields/retry@v3 | |
| with: | |
| polling_interval_seconds: 30 | |
| retry_wait_seconds: 60 | |
| timeout_minutes: 20 | |
| max_attempts: 3 | |
| command: bin/run-calldata-printing.sh | |
| - name: Comment PR with Calldata Printing Output | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| if (fs.existsSync('output.txt')) { | |
| let output = fs.readFileSync('output.txt', 'utf8'); | |
| const lines = output.split(/\r?\n/); | |
| let lastProposalEndIdx = -1; | |
| for (let i = 0; i < lines.length; i++) { | |
| if (lines[i].trim().includes('PROPOSAL END')) { | |
| lastProposalEndIdx = i; | |
| } | |
| } | |
| const tailToCheck = lastProposalEndIdx >= 0 && lastProposalEndIdx + 1 < lines.length | |
| ? lines.slice(lastProposalEndIdx + 1).join('\n') | |
| : output; | |
| // only want to log the proposal + calldata when there are no failures, and there are no dev proposals | |
| const failed = /\b(failed|revert)\b/i.test(tailToCheck); | |
| const withDevProposals = /\bPROPOSAL START\b/i.test(output); | |
| if (!failed && withDevProposals) { | |
| // truncate to last 65k characters for github comment | |
| const MAX_LEN = 65000; | |
| if (output.length > MAX_LEN) { | |
| output = output.slice(-MAX_LEN); | |
| } | |
| const prNumber = context.payload.pull_request.number; | |
| github.rest.issues.createComment({ | |
| ...context.repo, | |
| issue_number: prNumber, | |
| body: `\`\`\`\n${output}\n\`\`\`` | |
| }); | |
| } | |
| } | |
| run-post-proposal-tests: | |
| name: Post Proposal Integration Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions | |
| - name: Setup MIPs Permissions | |
| uses: ./.github/actions/setup-mips-permissions | |
| - name: Run Integration Test | |
| uses: nick-fields/retry@v3 | |
| with: | |
| polling_interval_seconds: 30 | |
| retry_wait_seconds: 60 | |
| timeout_minutes: 20 | |
| max_attempts: 1 | |
| command: time forge test --match-contract PostProposalTest -vvv --ffi |