Skip to content

Implement GH actions for compiling, exporting and comparing hashes#251

Open
elle-j wants to merge 15 commits intomainfrom
lj/gh-actions-hashes
Open

Implement GH actions for compiling, exporting and comparing hashes#251
elle-j wants to merge 15 commits intomainfrom
lj/gh-actions-hashes

Conversation

@elle-j
Copy link
Copy Markdown
Contributor

@elle-j elle-j commented Mar 12, 2026

Summary

Adds GH actions usable by other repos' workflows.

Actions:

  • Run retester in compile-only mode, which compiles contracts, hashes the bytecode, and generates a report
  • Run report-processor to extract and export the bytecode hashes from a report generated by retester
  • Run report-processor to compare the bytecode hashes in the exported hash files

Example usage:

jobs:
  compile-and-export-hashes:
    strategy:
      fail-fast: false
      matrix:
        include:
          # ..matrix of platforms..
    runs-on: ${{ matrix.runner }}
    steps:

      # ...

      - name: Compile Contracts
        id: compile
        uses: paritytech/revive-differential-tests/.github/actions/compile-contracts
        with:
          revive-differential-tests-ref: some-ref
          resolc-path: path/to/resolc/binary
          solc-version: "0.8.33"
          modes: "Y M0 S+, Y M3 S+, Y Mz S+"
          upload-artifact-name: compilation-report-${{ matrix.platform }}

      - name: Export Bytecode Hashes
        uses: paritytech/revive-differential-tests/.github/actions/export-bytecode-hashes
        with:
          revive-differential-tests-ref: some-ref
          report-path: ${{ steps.compile.outputs.report-path }}
          remove-prefix: ${{ steps.compile.outputs.contracts-source-prefix }}
          platform-label: ${{ matrix.platform }}
          upload-artifact-name: hashes-${{ matrix.platform }}

  compare-hashes:
    needs: [compile-and-export-hashes]
    runs-on: ubuntu-24.04
    steps:

      # ...

      - name: Compare Bytecode Hashes
        uses: paritytech/revive-differential-tests/.github/actions/compare-bytecode-hashes
        with:
          revive-differential-tests-ref: some-ref
          hash-artifact-names: "hashes-linux, hashes-macos, hashes-windows"
          modes: "Y M0 S+, Y M3 S+, Y Mz S+"
          upload-artifact-name: hash-comparison-result

@elle-j elle-j marked this pull request as ready for review March 17, 2026 13:00
@elle-j elle-j requested review from 0xOmarA, kvpanch and xermicus March 17, 2026 13:17
Base automatically changed from lj/compare-hashes to main April 8, 2026 13:05
@elle-j elle-j force-pushed the lj/gh-actions-hashes branch from a4b37f3 to 4148afc Compare April 8, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants