Skip to content

Commit

Permalink
ci: add linting and improve build/release times
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
  • Loading branch information
elpiel committed May 31, 2023
1 parent 5b74047 commit 04a046c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,43 @@ name: Build
on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: x86_64-unknown-linux-gnu, wasm32-unknown-unknown

- name: Lint - rustfmt
run: cargo fmt --all -- --check

- name: Lint - clippy
run: cargo clippy --all --no-deps -- -D warnings

build:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 12
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Set default rust toolchain
run: rustup default 1.64.0
- name: Install wasm-pack
run: cargo install --version 0.10.3 wasm-pack
- name: Rust setup
uses: dtolnay/rust-toolchain@1.64.0
with:
targets: wasm32-unknown-unknown
- uses: taiki-e/install-action@v2
with:
tool: wasm-pack@0.10.3
- name: Install NPM dependencies
run: npm ci
- name: Build
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 12
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Set default rust toolchain
run: rustup default 1.64.0
- name: Install wasm-pack
run: cargo install --version 0.10.3 wasm-pack

- name: Rust setup
uses: dtolnay/rust-toolchain@1.64.0
with:
targets: wasm32-unknown-unknown
- uses: taiki-e/install-action@v2
with:
tool: wasm-pack@0.10.3
- name: Install NPM dependencies
run: npm ci
- name: Build
Expand Down

0 comments on commit 04a046c

Please sign in to comment.