Skip to content

Commit

Permalink
chore: updates docs, readme, templates, workflow updates (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Nov 8, 2023
1 parent 4f28ff8 commit 4c0e1ce
Show file tree
Hide file tree
Showing 31 changed files with 1,237 additions and 838 deletions.
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/BUG-FORM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ body:
description: What component is the bug in?
multiple: true
options:
- Forge
- Cast
- Anvil
- Foundryup
- Chisel
- zkForge
- zkCast
- Other (please describe)
validations:
required: true
Expand Down
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/FEATURE-FORM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ body:
description: What component is the feature for?
multiple: true
options:
- Forge
- Cast
- Anvil
- Foundryup
- Chisel
- zkForge
- zkCast
- Other (please describe)
validations:
required: true
Expand Down
30 changes: 13 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
# What :computer:
* First thing updated with this PR
* Second thing updated with this PR
* Third thing updated with this PR

Bug fixes and new features should include tests.
-->
# Why :hand:
* Reason why first thing was added to PR
* Reason why second thing was added to PR
* Reason why third thing was added to PR

## Motivation
# Evidence :camera:
Include screenshots, screen recordings, or `console` output here demonstrating that your changes work as intended

<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->
<!-- All sections below are optional. You can uncomment any section applicable to your Pull Request. -->

## Solution

<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->
<!-- # Notes :memo:
* Any notes/thoughts that the reviewers should know prior to reviewing the code? -->
18 changes: 18 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
lint:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: deny

on:
push:
branches: [master]
branches: [main]
paths: [Cargo.lock, deny.toml]
pull_request:
branches: [master]
branches: [main]
paths: [Cargo.lock, deny.toml]

env:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/project.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-docker:
name: Release Docker
uses: ./.github/workflows/docker-publish.yml

release:
name: ${{ matrix.target }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -238,8 +234,8 @@ jobs:
issue:
name: Open an issue
runs-on: ubuntu-latest
needs: [prepare, release-docker, release, cleanup]
if: failure()
needs: [prepare, release, cleanup]
if: ${{ failure() }}
steps:
- uses: actions/checkout@v4
- uses: JasonEtco/create-an-issue@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
Expand Down
99 changes: 23 additions & 76 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: test
on:
push:
branches:
- master
- main
pull_request:

concurrency:
Expand All @@ -14,79 +14,24 @@ env:
CARGO_TERM_COLOR: always

jobs:
matrices:
name: build matrices
runs-on: ubuntu-latest
outputs:
test-matrix: ${{ steps.gen.outputs.test-matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Generate matrices
id: gen
env:
EVENT_NAME: ${{ github.event_name }}
run: |
output=$(python3 .github/scripts/matrices.py)
echo "::debug::test-matrix=$output"
echo "test-matrix=$output" >> $GITHUB_OUTPUT
test:
name: test ${{ matrix.name }}
runs-on: ${{ matrix.os }}
doctests:
name: doc tests
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
needs: matrices
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrices.outputs.test-matrix) }}
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: taiki-e/install-action@nextest
# - uses: taiki-e/setup-cross-toolchain-action@v1
# with:
# target: ${{ 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') }}
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
# key: ${{ matrix.target }}
cache-on-failure: true
- name: Setup Git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
git config --global url."https://github.com/".insteadOf "[email protected]:"
- name: Test
cache-on-failure: true
- name: cargo test
run: cargo test --doc -p zkforge -p zkcast
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
run: cargo nextest run ${{ matrix.flags }}

doctest:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --workspace --doc
RUST_TEST_THREADS: 2

clippy:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@clippy
Expand All @@ -97,9 +42,10 @@ jobs:
env:
RUSTFLAGS: -Dwarnings

rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 30
fmt:
name: fmt
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
Expand All @@ -109,10 +55,10 @@ jobs:

forge-fmt:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
Expand All @@ -124,12 +70,13 @@ jobs:
shopt -s extglob
cargo run --bin forge -- fmt --check testdata/**/!(Vm).sol
crate-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
feature-checks:
name: feature checks
runs-on: ubuntu-22.04-github-hosted-16core
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
with:
Expand Down
Loading

0 comments on commit 4c0e1ce

Please sign in to comment.