Skip to content

Commit dd0b071

Browse files
committed
fix ci invocation of test
also add nicer separation of local dev and ci entrypoints Signed-off-by: clux <[email protected]>
1 parent fecdc17 commit dd0b071

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
shell: bash
7979
run: |
8080
docker buildx build --platform ${{ matrix.platform }} --output type=docker -t test-runner - < Dockerfile.test-runner
81-
TARGET_DIR=${{ matrix.target_dir }} PLATFORM=${{ matrix.platform }} just test
81+
TARGET_DIR=${{ matrix.target_dir }} PLATFORM=${{ matrix.platform }} just test-ci
8282
8383
# The date/channel/version are expected to be the same on both architectures and are needed for the merge step.
8484
# We store them here since it makes the merge step a bit easier - it doesn't need to figure out which of the

.github/workflows/stable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
shell: bash
9393
run: |
9494
docker buildx build --platform ${{ matrix.platform }} --output type=docker -t test-runner - < Dockerfile.test-runner
95-
TARGET_DIR=${{ matrix.target_dir }} PLATFORM=${{ matrix.platform }} just test
95+
TARGET_DIR=${{ matrix.target_dir }} PLATFORM=${{ matrix.platform }} just test-ci
9696
9797
# The date/channel/version are expected to be the same on both architectures and are needed for the merge step.
9898
# We store them here since it makes the merge step a bit easier - it doesn't need to figure out which of the

justfile

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
[private]
43
default:
54
@just --list --unsorted --color=always
@@ -19,33 +18,38 @@ build-nightly-arm: (_build "nightly" "arm64" "linux/arm64" "arm64")
1918
run:
2019
docker run -v $PWD/test:/volume -w /volume -it rustmusl-temp /bin/bash
2120

21+
# Build test runner
2222
test-setup:
2323
docker build -t test-runner . -f Dockerfile.test-runner
2424

2525
# Test an individual crate against built container
2626
_t crate:
27-
just {{ ENVIRON_FN }} {{crate}}
27+
./test.sh {{crate}}
2828

29-
# poor man's environment detection for a man with 2 machines
30-
ENVIRON_FN := if os() == "macos" { "_t_arm" } else { "_t_amd" }
31-
# when running locally use one of these instead of _t
32-
_t_amd crate:
29+
# Test an individual crate locally using env vars set by _t_amd or t_arm
30+
_ti crate:
31+
# poor man's environment multiplex
32+
just _t_{{ os() }}_{{ arch() }} {{crate}}
33+
34+
# when running locally we can use one of these instead of _t
35+
_t_linux_amd64 crate:
3336
#!/bin/bash
3437
export PLATFORM="linux/amd64"
3538
export TARGET_DIR="x86_64-unknown-linux-musl"
3639
export AR="amd64"
3740
./test.sh {{crate}}
38-
_t_arm crate:
41+
_t_macos_aarch64 crate:
3942
#!/bin/bash
4043
export PLATFORM="linux/arm64"
4144
export TARGET_DIR="aarch64-unknown-linux-musl"
4245
export AR="arm64"
4346
./test.sh {{crate}}
4447

45-
46-
# Test all crates against built container
48+
# Test all crates against built container locally
49+
test: (_ti "plain") (_ti "ssl") (_ti "rustls") (_ti "pq") (_ti "serde") (_ti "zlib") (_ti "hyper") (_ti "dieselpg") (_ti "dieselsqlite")
50+
# Test all crates against built container in ci (inheriting set PLATFORM/TARGET_DIR/AR vars)
51+
test-ci: (_t "plain") (_t "ssl") (_t "rustls") (_t "pq") (_t "serde") (_t "zlib") (_t "hyper") (_t "dieselpg") (_t "dieselsqlite")
4752
# NB: taken out curl for #96 and build issuse
48-
test: (_t "plain") (_t "ssl") (_t "rustls") (_t "pq") (_t "serde") (_t "zlib") (_t "hyper") (_t "dieselpg") (_t "dieselsqlite")
4953

5054
# Cleanup everything
5155
clean: clean-docker clean-tests

0 commit comments

Comments
 (0)