-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathjustfile
64 lines (53 loc) · 2.23 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[private]
default:
@just --list --unsorted --color=always
_build channel ar platform ext:
docker build --build-arg CHANNEL="{{channel}}" --build-arg AR="{{ar}}" --platform="{{platform}}" -t rustmusl-temp . -f Dockerfile.{{ext}}
# Build the stable x86 container
build-stable-amd: (_build "stable" "amd64" "linux/amd64" "x86_64")
# Build the nightly x86 container
build-nightly-amd: (_build "nightly" "amd64" "linux/amd64" "x86_64")
# Build the stable arm container
build-stable-arm: (_build "stable" "arm64" "linux/arm64" "arm64")
# Build the nightly arm container
build-nightly-arm: (_build "nightly" "arm64" "linux/arm64" "arm64")
# Shell into the built container
run:
docker run -v $PWD/test:/volume -w /volume -it rustmusl-temp /bin/bash
# Build test runner
test-setup:
docker build -t test-runner . -f Dockerfile.test-runner
# Test an individual crate against built container
_t crate:
./test.sh {{crate}}
# Test an individual crate locally using env vars set by _t_amd or t_arm
_ti crate:
# poor man's environment multiplex
just _t_{{ os() }}_{{ arch() }} {{crate}}
# when running locally we can use one of these instead of _t
_t_linux_amd64 crate:
#!/bin/bash
export PLATFORM="linux/amd64"
export TARGET_DIR="x86_64-unknown-linux-musl"
export AR="amd64"
./test.sh {{crate}}
_t_macos_aarch64 crate:
#!/bin/bash
export PLATFORM="linux/arm64"
export TARGET_DIR="aarch64-unknown-linux-musl"
export AR="arm64"
./test.sh {{crate}}
# Test all crates against built container locally
test: (_ti "plain") (_ti "ssl") (_ti "rustls") (_ti "pq") (_ti "serde") (_ti "zlib") (_ti "hyper") (_ti "dieselpg") (_ti "dieselsqlite")
# Test all crates against built container in ci (inheriting set PLATFORM/TARGET_DIR/AR vars)
test-ci: (_t "plain") (_t "ssl") (_t "rustls") (_t "pq") (_t "serde") (_t "zlib") (_t "hyper") (_t "dieselpg") (_t "dieselsqlite")
# Cleanup everything
clean: clean-docker clean-tests
# Cleanup docker images with clux/muslrus_t name
clean-docker:
docker images clux/muslrust -q | xargs -r docker rmi -f
# Cleanup test artifacts
clean-tests:
sudo find . -iname Cargo.lock -exec rm {} \;
sudo find . -mindepth 3 -maxdepth 3 -name target -exec rm -rf {} \;
sudo rm -f test/dieselsqlitecrate/main.db