Skip to content

Commit

Permalink
Add support for keygen commands and some internal refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
cr-fuel committed Sep 30, 2023
1 parent 994b1c4 commit 95c364d
Show file tree
Hide file tree
Showing 12 changed files with 784 additions and 144 deletions.
109 changes: 80 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Run mdbook build
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.25'
mdbook-version: "0.4.25"
- name: Emit book logs to tmp.txt, fail if build logs contain 'ERROR'
run: |
MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs/book &> tmp.txt
Expand Down Expand Up @@ -204,10 +204,14 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: 'Build Workspace'
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: "Build Workspace"
run: cargo build --locked --workspace --all-features --all-targets
env:
RUSTFLAGS: '-D warnings'
RUSTFLAGS: "-D warnings"

cargo-clippy:
runs-on: ubuntu-latest
Expand All @@ -218,6 +222,10 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Check Clippy Linter
run: cargo clippy --all-features --all-targets -- -D warnings
Expand All @@ -230,11 +238,15 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-toml-lint
version: '0.1'
version: "0.1"
- name: Run Cargo.toml linter
run: git ls-files | grep Cargo.toml$ | grep -v 'templates/sway-test-rs' | xargs --verbose -n 1 cargo-toml-lint

Expand Down Expand Up @@ -263,6 +275,10 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Cargo Run E2E Tests (Fuel VM)
run: cargo run --locked --release --bin test -- --locked
Expand All @@ -276,6 +292,10 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Cargo Run E2E Tests (EVM)
run: cargo run --locked --release --bin test -- --target evm --locked

Expand All @@ -288,6 +308,10 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Cargo Run E2E Tests (EVM)
run: cargo run --locked --release --bin test -- --target midenvm --locked

Expand All @@ -301,6 +325,10 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Build All Tests
run: cargo run --locked -p forc -- build --locked --path ./test/src/sdk-harness
- name: Cargo Test sway-lib-std
Expand All @@ -316,6 +344,10 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Install Forc
run: cargo install --locked --debug --path ./forc
Expand All @@ -339,8 +371,8 @@ jobs:
run: ./benchmark.sh --prepare-for-commit
- uses: EndBug/add-and-commit@v9
with:
cwd: './performance-data'
message: 'Updated benchmark data'
cwd: "./performance-data"
message: "Updated benchmark data"
default_author: github_actions

forc-unit-tests:
Expand All @@ -351,6 +383,10 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Install Forc
run: cargo install --locked --debug --path ./forc
Expand All @@ -365,8 +401,11 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2

- name: Install cargo-deps
run: cargo install cargo-deps

Expand Down Expand Up @@ -396,10 +435,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --locked
Expand All @@ -413,6 +460,10 @@ jobs:
with:
# `cargo-udeps` requires nightly to run
toolchain: ${{ env.NIGHTLY_RUST_VERSION }}
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- uses: Swatinem/rust-cache@v2
- name: Install cargo-udeps
run: cargo install --locked cargo-udeps
Expand Down Expand Up @@ -443,10 +494,10 @@ jobs:
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>"
footer: ""
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

Expand Down Expand Up @@ -494,10 +545,10 @@ jobs:
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>"
footer: ""
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

Expand Down Expand Up @@ -543,10 +594,10 @@ jobs:
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>"
footer: ""
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

Expand Down Expand Up @@ -619,10 +670,10 @@ jobs:
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>"
footer: ""
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

Expand Down Expand Up @@ -674,10 +725,10 @@ jobs:
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>"
footer: ""
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

Expand Down Expand Up @@ -722,13 +773,13 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
key: '${{ matrix.job.target }}'
key: "${{ matrix.job.target }}"

- name: Use Cross
uses: baptiste0928/cargo-install@v1
with:
crate: cross
cache-key: '${{ matrix.job.target }}'
cache-key: "${{ matrix.job.target }}"

- name: Build forc binaries
run: |
Expand Down
Loading

0 comments on commit 95c364d

Please sign in to comment.