Skip to content

Commit

Permalink
feat(ci): test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfourzerofour committed Aug 25, 2023
1 parent 0341475 commit 9da1169
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
30 changes: 30 additions & 0 deletions .github/actions/toolchain/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Build Toolchain'
description: 'Common commands for our build steps'

inputs:
rust_components:
description: 'Components for rust'
required: false
type: string
default: ''

runs:
using: "composite"
steps:
- name: Install protobuf
run: sudo apt-get install -y protobuf-compiler
shell: bash
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
shell: bash
with:
toolchain: 1.71.0
components: ${{ inputs.rust_components }}
- uses: Swatinem/rust-cache@v2
shell: bash
with:
cache-on-failure: true
- name: Install Foundry
shell: bash
uses: foundry-rs/foundry-toolchain@v1

39 changes: 6 additions & 33 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,7 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install protobuf
run: sudo apt-get install -y protobuf-compiler
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.0
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- uses: ./.github/actions/toolchain
- name: Run tests
run: cargo test

Expand All @@ -29,17 +19,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install protobuf
run: sudo apt-get install -y protobuf-compiler
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.0
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- uses: ./.github/actions/toolchain
- name: Run tests
run: cargo test
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
Expand All @@ -53,20 +35,11 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install protobuf
run: sudo apt-get -y install protobuf-compiler
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/toolchain
with:
components: clippy
toolchain: 1.71.0
rust_components: clippy
- name: Install toolchain (nightly)
run: rustup toolchain add nightly --component rustfmt --profile minimal
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
# Build to generate the ABI bindings.
- name: cargo build
uses: actions-rs/cargo@v1
Expand Down

0 comments on commit 9da1169

Please sign in to comment.