A fork of attic a self-hostable Nix Binary Cache server
1set positional-arguments
2
3here := env_var_or_default("JUST_INVOCATION_DIR", invocation_directory())
4base := `pwd`
5
6#@echo "here: {{ here }}"
7#@echo "base: {{ base }}"
8
9# List available targets
10list:
11 @just --list --unsorted
12
13# Run a command with an alternative Nix version
14with-nix version *command:
15 set -e; \
16 hook="$(jq -e -r '.[$version].shellHook' --arg version "{{ version }}" < "$NIX_VERSIONS" || (>&2 echo "Version {{ version }} doesn't exist"; exit 1))"; \
17 eval "$hook"; \
18 CARGO_TARGET_DIR="{{ base }}/target/nix-{{ version }}" \
19 {{ command }}
20
21# (CI) Build WebAssembly crates
22ci-build-wasm:
23 #!/usr/bin/env bash
24 set -euxo pipefail
25
26 # https://github.com/rust-lang/rust/issues/122357
27 export RUST_MIN_STACK=16777216
28
29 pushd attic
30 cargo build --target wasm32-unknown-unknown --no-default-features -F chunking -F io
31 popd
32 pushd token
33 cargo build --target wasm32-unknown-unknown
34 popd
35
36# (CI) Run unit tests
37ci-unit-tests matrix:
38 #!/usr/bin/env bash
39 set -euxo pipefail
40
41 system=$(nix-instantiate --eval -E 'builtins.currentSystem')
42 tests=$(nix build .#internalMatrix."$system".\"{{ matrix }}\".attic-tests --no-link --print-out-paths -L)
43 find "$tests/bin" -exec {} \;
44
45# (CI) Run rustfmt check
46ci-rustfmt:
47 cargo fmt --check
48
49# (CI) Build and push images
50ci-build-and-push-images *args:
51 .ci/build-and-push-images.sh {{ args }}