Skip to content

Commit

Permalink
Better CI workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerclique committed Jul 23, 2024
1 parent 91aa4f7 commit f97b73f
Showing 1 changed file with 12 additions and 77 deletions.
89 changes: 12 additions & 77 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
formatting:
name: Format
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -18,7 +18,7 @@ jobs:
with:
components: rustfmt

- name: Check formatting Wirdigen
- name: Check formatting Wirdigen CLI
uses: actions-rust-lang/rustfmt@v1
with:
manifest-path: './Cargo.toml'
Expand All @@ -28,8 +28,8 @@ jobs:
with:
manifest-path: './wasm/Cargo.toml'

check_cli:
name: Check Wirdigen CLI
wirdigen_cli:
name: Wirdigen CLI
needs: formatting
runs-on: ubuntu-latest
steps:
Expand All @@ -38,54 +38,23 @@ jobs:

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy

- name: Check sources
run: cargo check --release

clippy_cli:
name: Run linter Wirdigen CLI
needs: check_cli
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run cargo clippy
- name: Run clippy
run: cargo clippy

build_cli:
name: Build Wirdigen CLI
needs: check_cli
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build sources
run: cargo build --release

test_cli:
name: Test Wirdigen CLI
needs: build_cli
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run tests
run: cargo test --release

build_wasm:
name: Build Wirdigen WASM
wirdigen_wasm:
name: Wirdigen WASM
needs: formatting
runs-on: ubuntu-latest
steps:
Expand All @@ -99,42 +68,8 @@ jobs:
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build sources
run: |
cd wasm
wasm-pack build -t nodejs --out-name wirdigen --release
test_wasm:
name: Test Wirdigen WASM
needs: build_wasm
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Run tests
run: wasm-pack build wasm -t nodejs --out-name wirdigen_wasm --target-dir target

pack_wasm:
name: Pack Wirdigen WASM
needs: test_wasm
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build sources
run: |
wasm-pack build wasm -t nodejs --out-name wirdigen_wasm --target-dir target
wasm-pack pack wasm
- name: Pack NPM package
run: wasm-pack pack wasm

0 comments on commit f97b73f

Please sign in to comment.