mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
# Ensures that `Compact` codec changes are backwards compatible.
|
|
#
|
|
# 1) checkout `main`
|
|
# 2) randomly generate and serialize to disk many different type vectors with `Compact` (eg. Header, Transaction, etc)
|
|
# 3) checkout `pr`
|
|
# 4) deserialize previously generated test vectors
|
|
|
|
on:
|
|
pull_request:
|
|
merge_group:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTC_WRAPPER: "sccache"
|
|
|
|
name: compact-codec
|
|
permissions: {}
|
|
|
|
jobs:
|
|
compact-codec:
|
|
runs-on: ${{ github.repository == 'paradigmxyz/reth' && 'depot-ubuntu-latest' || 'ubuntu-latest' }}
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
bin:
|
|
- cargo run --bin reth --features "dev"
|
|
steps:
|
|
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
|
|
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
with:
|
|
cache-on-failure: true
|
|
- name: Checkout base
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
ref: ${{ github.base_ref || 'main' }}
|
|
persist-credentials: false
|
|
# On `main` branch, generates test vectors and serializes them to disk using `Compact`.
|
|
- name: Generate compact vectors
|
|
run: |
|
|
${{ matrix.bin }} -- test-vectors compact --write
|
|
- name: Checkout PR
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
clean: false
|
|
persist-credentials: false
|
|
# On incoming merge try to read and decode previously generated vectors with `Compact`
|
|
- name: Read vectors
|
|
run: ${{ matrix.bin }} -- test-vectors compact --read
|