Skip to content

Commit

Permalink
Use app build container for building test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Dec 8, 2023
1 parent 8fab0ca commit cc72c41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
FROM debian:stable

RUN apt-get update && apt-get install -y \
gcc curl libdbus-1-dev protobuf-compiler
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ARG IMAGE=ghcr.io/mullvad/mullvadvpn-app-build:latest
FROM $IMAGE
6 changes: 4 additions & 2 deletions test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
set -eu

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_DIR="$SCRIPT_DIR/.."
cd "$SCRIPT_DIR"

if [[ $TARGET == x86_64-unknown-linux-gnu ]]; then
mkdir -p .container/cargo-registry
podman build -t mullvadvpn-app-tests .
container_image=$(cat "$APP_DIR/building/linux-container-image.txt")
podman build -t mullvadvpn-app-tests --build-arg IMAGE="${container_image}" .

podman run --rm -it \
-v "${SCRIPT_DIR}/.container/cargo-registry":/root/.cargo/registry \
-v "${SCRIPT_DIR}/..":/src:Z \
-v "${APP_DIR}":/src:Z \
-e CARGO_HOME=/root/.cargo/registry \
mullvadvpn-app-tests \
/bin/bash -c "cd /src/test/; cargo build --bin test-runner --release --target ${TARGET}"
Expand Down

0 comments on commit cc72c41

Please sign in to comment.