mirror of
https://github.com/zhaofengli/attic.git
synced 2025-03-15 13:07:49 +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_CACHE: ${{ secrets.ATTIC_CACHE }}
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||||
|
|
||||||
- name: Build and run tests
|
- name: Cache dev shell
|
||||||
run: |
|
run: |
|
||||||
|
.ci/cache-shell.sh
|
||||||
system=$(nix-instantiate --eval -E 'builtins.currentSystem')
|
system=$(nix-instantiate --eval -E 'builtins.currentSystem')
|
||||||
echo system=$system >>$GITHUB_ENV
|
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)
|
tests=$(nix build .#internalMatrix."$system".\"${{ matrix.nix }}\".attic-tests --no-link --print-out-paths -L)
|
||||||
find "$tests/bin" -exec {} \;
|
find "$tests/bin" -exec {} \;
|
||||||
|
|
||||||
- name: Build WebAssembly crates
|
- name: Build WebAssembly crates
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/rust-lang/rust/issues/122357
|
.ci/run just ci-build-wasm
|
||||||
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
|
|
||||||
|
|
||||||
# TODO: Just take a diff of the list of store paths, also abstract all of this out
|
# TODO: Just take a diff of the list of store paths, also abstract all of this out
|
||||||
- name: Push build artifacts
|
- name: Push build artifacts
|
||||||
|
|
15
justfile
15
justfile
|
@ -17,3 +17,18 @@ with-nix version *command:
|
||||||
eval "$hook"; \
|
eval "$hook"; \
|
||||||
CARGO_TARGET_DIR="{{ base }}/target/nix-{{ version }}" \
|
CARGO_TARGET_DIR="{{ base }}/target/nix-{{ version }}" \
|
||||||
{{ command }}
|
{{ 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…
Add table
Reference in a new issue