Skip to content

Commit

Permalink
add pre-build job
Browse files Browse the repository at this point in the history
  • Loading branch information
DougAnderson444 committed Dec 5, 2024
1 parent ae5aa58 commit 7107c64
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,41 @@ env:
RUSTDOCFLAGS: -D warnings -A static_mut_refs

jobs:
# this job pre-build using `just build` and uploads the .wasm files before running other jobs
# all other jobs depend on this one
pre-build:
name: Pre-Build wasm binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: extractions/setup-just@v2

# binstall is faster than cargo install
- name: Install binstall
uses: taiki-e/install-action@cargo-binstall

- name: Install cargo-component
run: echo yes | cargo binstall cargo-component

- name: install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- run: just build

- name: upload artifacts to target
uses: actions/upload-artifact@v4
with:
name: wasm-files-target
path: target/wasm32-unknown-unknown/**/*.wasm
overwrite: true

# check:
# name: Check
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -26,6 +58,7 @@ jobs:
# check_wasm:
# name: Check wasm32
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -42,6 +75,7 @@ jobs:
# test:
# name: Test Suite
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -58,6 +92,7 @@ jobs:
# fmt:
# name: Rustfmt
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -74,6 +109,7 @@ jobs:
# clippy:
# name: Clippy
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -90,6 +126,7 @@ jobs:
# trunk:
# name: trunk
# runs-on: ubuntu-latest
# needs: pre-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
Expand All @@ -105,6 +142,7 @@ jobs:

build:
runs-on: ${{ matrix.os }}
needs: pre-build
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -135,6 +173,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create directories
run: |
mkdir -p target/wasm32-unknown-unknown/release
mkdir -p assets
- uses: actions/download-artifact@v4
with:
name: wasm-files-target
path: target/wasm32-unknown-unknown

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
Expand Down

0 comments on commit 7107c64

Please sign in to comment.