-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
28 lines (23 loc) · 860 Bytes
/
justfile
File metadata and controls
28 lines (23 loc) · 860 Bytes
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
TestImageName := "a10n/aarch64codegen-testenv"
TestDockerfile := "Dockerfile.testenv"
Workdir := "/aarch64codegen"
TestCommand := "go test ./... -coverprofile=coverage.out"
CoverageFile := "coverage.out"
DockerPlatforms := "linux/amd64,linux/arm64"
# run the package tests inside the testing docker environment container
test:
#!/usr/bin/env bash
set -euxo pipefail
Container=$(docker run -di {{TestImageName}})
docker cp . $Container:{{Workdir}}
docker exec $Container /bin/sh -c "{{TestCommand}}"
docker cp $Container:{{Workdir}}/{{CoverageFile}} {{CoverageFile}}
docker kill $Container
docker rm $Container
# build and push the test environment docker image
build-testenv:
docker buildx build --platform {{DockerPlatforms}} \
-f {{TestDockerfile}} \
-t {{TestImageName}} \
--push \
.