forked from scroll-tech/scroll-prover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common zkevm and types (scroll-tech#1)
- Loading branch information
1 parent
d69c27a
commit 1b1a9ec
Showing
24 changed files
with
7,214 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
RUST_LOG=info | ||
RUST_BACKTRACE=1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
SCCACHE_REGION: ap-northeast-1 | ||
SCCACHE_BUCKET: ff-building | ||
SCCACHE_S3_USE_SSL: true | ||
SCCACHE_S3_KEY_PREFIX: sccache-gh-action | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
CARGO_INCREMENTAL: false | ||
|
||
jobs: | ||
fmt: | ||
name: fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2021-11-17 | ||
override: true | ||
components: rustfmt, clippy | ||
- name: Cache cargo registry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo target | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Setup sccache | ||
run: | | ||
cd $RUNNER_TEMP | ||
export NAME="sccache-v0.2.15-x86_64-unknown-linux-musl" | ||
curl -fsSOL https://github.com/mozilla/sccache/releases/download/v0.2.15/$NAME.tar.gz | ||
tar xzf $NAME.tar.gz | ||
mkdir -p ~/.cargo/bin | ||
mv ./$NAME/sccache ~/.cargo/bin | ||
chmod +x ~/.cargo/bin/sccache | ||
printf "[build]\nrustc-wrapper = \"/home/runner/.cargo/bin/sccache\"" >> ~/.cargo/config | ||
~/.cargo/bin/sccache -s | ||
- name: Run cargo fmt | ||
run: | | ||
cargo build --release | ||
cargo fmt --all -- --check | ||
- name: Show sccache stats | ||
run: ~/.cargo/bin/sccache -s | ||
|
||
clippy: | ||
name: clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2021-11-17 | ||
override: true | ||
components: rustfmt, clippy | ||
- name: Cache cargo registry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo target | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Setup sccache | ||
run: | | ||
cd $RUNNER_TEMP | ||
export NAME="sccache-v0.2.15-x86_64-unknown-linux-musl" | ||
curl -fsSOL https://github.com/mozilla/sccache/releases/download/v0.2.15/$NAME.tar.gz | ||
tar xzf $NAME.tar.gz | ||
mkdir -p ~/.cargo/bin | ||
mv ./$NAME/sccache ~/.cargo/bin | ||
chmod +x ~/.cargo/bin/sccache | ||
printf "[build]\nrustc-wrapper = \"/home/runner/.cargo/bin/sccache\"" >> ~/.cargo/config | ||
~/.cargo/bin/sccache -s | ||
- name: Run cargo clippy | ||
run: | | ||
cargo build --release | ||
cargo clippy --release -- -D warnings | ||
- name: Show sccache stats | ||
run: ~/.cargo/bin/sccache -s |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Unit Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
SCCACHE_REGION: ap-northeast-1 | ||
SCCACHE_BUCKET: ff-building | ||
SCCACHE_S3_USE_SSL: true | ||
SCCACHE_S3_KEY_PREFIX: sccache-gh-action | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
CARGO_INCREMENTAL: false | ||
|
||
jobs: | ||
linux-test: | ||
name: Linux Test on ${{ matrix.rust }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [amd64] | ||
rust: [nightly] | ||
container: | ||
image: ${{ matrix.arch }}/rust | ||
env: | ||
# Disable full debug symbol generation to speed up CI build and keep memory down | ||
# "1" means line tables only, which is useful for panic tracebacks. | ||
RUSTFLAGS: "-C debuginfo=1" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Cache Cargo Index | ||
uses: actions/cache@v2 | ||
with: | ||
path: /github/home/.cargo/git | ||
key: ${{ runner.os }}-${{ matrix.arch }}-index-cache-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache Cargo Registry | ||
uses: actions/cache@v2 | ||
with: | ||
path: /github/home/.cargo/registry | ||
key: ${{ runner.os }}-${{ matrix.arch }}-registry-cache-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache Cargo Target | ||
uses: actions/cache@v2 | ||
with: | ||
path: /github/home/target | ||
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Setup sccache | ||
run: | | ||
cd $RUNNER_TEMP | ||
export NAME="sccache-v0.2.15-x86_64-unknown-linux-musl" | ||
curl -fsSOL https://github.com/mozilla/sccache/releases/download/v0.2.15/$NAME.tar.gz | ||
tar xzf $NAME.tar.gz | ||
mkdir -p ~/.cargo/bin | ||
mv ./$NAME/sccache ~/.cargo/bin | ||
chmod +x ~/.cargo/bin/sccache | ||
printf "[build]\nrustc-wrapper = \"/home/runner/.cargo/bin/sccache\"" >> ~/.cargo/config | ||
~/.cargo/bin/sccache -s | ||
- name: Setup Rust toolchain | ||
run: | | ||
rustup toolchain install ${{ matrix.rust }} | ||
rustup default ${{ matrix.rust }} | ||
rustup component add rustfmt | ||
- name: Run tests | ||
run: cargo test | ||
- name: Show sccache stats | ||
run: ~/.cargo/bin/sccache -s | ||
env: | ||
CARGO_HOME: "/github/home/.cargo" | ||
CARGO_TARGET_DIR: "/github/home/target" |
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
Oops, something went wrong.