mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
.github: Factor WebAssembly build out to justfile
This commit is contained in:
parent
6b1d4520f3
commit
eeb4275172
2 changed files with 21 additions and 10 deletions
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
|
@ -45,25 +45,21 @@ jobs:
|
|||
ATTIC_CACHE: ${{ secrets.ATTIC_CACHE }}
|
||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||
|
||||
- name: Build and run tests
|
||||
- name: Cache dev shell
|
||||
run: |
|
||||
.ci/cache-shell.sh
|
||||
system=$(nix-instantiate --eval -E 'builtins.currentSystem')
|
||||
echo system=$system >>$GITHUB_ENV
|
||||
|
||||
- name: Build and run tests
|
||||
run: |
|
||||
tests=$(nix build .#internalMatrix."$system".\"${{ matrix.nix }}\".attic-tests --no-link --print-out-paths -L)
|
||||
find "$tests/bin" -exec {} \;
|
||||
|
||||
- name: Build WebAssembly crates
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
# https://github.com/rust-lang/rust/issues/122357
|
||||
export RUST_MIN_STACK=16777216
|
||||
|
||||
pushd attic
|
||||
nix develop .# --command -- cargo build --target wasm32-unknown-unknown --no-default-features -F chunking -F stream
|
||||
popd
|
||||
pushd token
|
||||
nix develop .# --command -- cargo build --target wasm32-unknown-unknown
|
||||
popd
|
||||
.ci/run just ci-build-wasm
|
||||
|
||||
# TODO: Just take a diff of the list of store paths, also abstract all of this out
|
||||
- name: Push build artifacts
|
||||
|
|
15
justfile
15
justfile
|
@ -17,3 +17,18 @@ with-nix version *command:
|
|||
eval "$hook"; \
|
||||
CARGO_TARGET_DIR="{{ base }}/target/nix-{{ version }}" \
|
||||
{{ command }}
|
||||
|
||||
# (CI) Build WebAssembly crates
|
||||
ci-build-wasm:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
|
||||
# https://github.com/rust-lang/rust/issues/122357
|
||||
export RUST_MIN_STACK=16777216
|
||||
|
||||
pushd attic
|
||||
cargo build --target wasm32-unknown-unknown --no-default-features -F chunking -F stream
|
||||
popd
|
||||
pushd token
|
||||
cargo build --target wasm32-unknown-unknown
|
||||
popd
|
||||
|
|
Loading…
Reference in a new issue