chore: updates docs, readme, templates, workflow updates #202
Workflow file for this run
This file contains 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: test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
cancel-in-progress: true | |
group: ${{github.workflow}}-${{github.ref}} | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-tests: | |
name: build tests | |
runs-on: [ubuntu-22.04-github-hosted-16core, macos-latest] | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
target: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- uses: taiki-e/install-action@nextest | |
- name: Build archive | |
shell: bash | |
run: | | |
cargo nextest archive \ | |
--workspace \ | |
--archive-file tests-${{ matrix.target }}.tar.zst | |
- name: Upload archive | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tests-${{ matrix.target }} | |
path: tests-${{ matrix.target }}.tar.zst | |
test: | |
name: runnning tests - ${{ matrix.name }} | |
runs-on: [ubuntu-22.04-github-hosted-16core, macos-latest] | |
timeout-minutes: 90 | |
needs: | |
- build-tests | |
strategy: | |
fail-fast: false | |
env: | |
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
target: ${{ matrix.target }} | |
- uses: taiki-e/install-action@nextest | |
- name: Download archive | |
uses: actions/download-artifact@v3 | |
with: | |
name: tests-${{ matrix.target }} | |
- name: Forge RPC cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.foundry/cache | |
~/.config/.foundry/cache | |
key: rpc-cache-${{ hashFiles('crates/forge/tests/rpc-cache-keyfile') }} | |
- name: Setup git config | |
run: | | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "<>" | |
- name: Force use of HTTPS for submodules | |
run: git config --global url."https://github.com/".insteadOf "[email protected]:" | |
- name: Test | |
shell: bash | |
run: | | |
# see https://github.com/foundry-rs/foundry/pull/3959 | |
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib" | |
cargo nextest run \ | |
--retries 2 \ | |
--archive-file tests-${{ matrix.target }}.tar.zst \ | |
${{ matrix.flags }} | |
doctests: | |
name: doc tests | |
runs-on: ubuntu-22.04-github-hosted-16core | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: cargo test | |
run: cargo test --doc -p zkforge -p zkcast | |
env: | |
RUST_TEST_THREADS: 2 | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- run: cargo clippy --workspace --all-targets --all-features | |
env: | |
RUSTFLAGS: -Dwarnings | |
fmt: | |
name: fmt | |
runs-on: ubuntu-22.04-github-hosted-16core | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt --all --check | |
forge-fmt: | |
name: forge fmt | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: forge fmt | |
run: cargo run --bin forge -- fmt --check testdata/ | |
feature-checks: | |
name: feature checks | |
runs-on: ubuntu-22.04-github-hosted-16core | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: cargo hack | |
run: cargo hack check |