Skip to content

Commit c3eb663

Browse files
committed
fix: makefile tests for ci
1 parent 8949674 commit c3eb663

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ steps:
2020
image: joseluisq/rust-linux-darwin-builder:latest
2121
pull: if-not-exists
2222
commands:
23-
- ./docker/image_test.sh
23+
- make test
2424

2525
trigger:
2626
event:

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ os:
77
- linux
88

99
script:
10-
- bash ./docker/image_test.sh
10+
- make test
1111

1212
notifications:
13-
email:
14-
on_success: never
15-
on_failure: always
13+
email: false

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
build:
22
docker build \
3-
-t joseluisq/rust-linux-darwin-builder:1 \
3+
-t joseluisq/rust-linux-darwin-builder:latest \
44
-f docker/Dockerfile .
55
.PHONY: build
66

7+
test:
8+
@sudo chown -R rust:rust ./
9+
@echo "Testing application..."
10+
@rustc -vV
11+
@echo "Compiling application(linux-musl x86_64)..."
12+
@cargo build --manifest-path=examples/hello-world/Cargo.toml --release --target x86_64-unknown-linux-musl
13+
@du -sh examples/hello-world/target/x86_64-unknown-linux-musl/release/helloworld
14+
@echo
15+
@echo "Compiling application(apple-darwin x86_64)..."
16+
@cargo build --manifest-path=examples/hello-world/Cargo.toml --release --target x86_64-apple-darwin
17+
@du -sh examples/hello-world/target/x86_64-apple-darwin/release/helloworld
18+
.ONESHELL: test
19+
720
release:
821
# 2. Update docker files to latest tag
922
./docker/version.sh $(TAG)

docker/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ RUN set -eux \
171171
&& curl -L -o ./tarballs/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz \
172172
https://s3.amazonaws.com/andrew-osx-sdks/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz \
173173
&& env UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh \
174-
&& ./cleanup.sh \
175-
&& rm -rf ./taballs \
174+
&& rm -rf *~ taballs *.tar.xz \
176175
&& rm -rf /tmp/*
177176

178177
ENV PATH $PATH:/home/rust/osxcross/target/bin

docker/image_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -euo pipefail
55

66
# Make sure we can build our main container.
7-
docker build -t joseluisq/rust-linux-darwin-builder .
7+
docker build -t joseluisq/rust-linux-darwin-builder -f docker/Dockerfile .
88

99
# Make sure we can build our example derived container.
1010
docker build -t rust-musl-zlib examples/adding-a-library

docker/tmpl.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ RUN set -eux \
171171
&& curl -L -o ./tarballs/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz \
172172
https://s3.amazonaws.com/andrew-osx-sdks/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz \
173173
&& env UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh \
174-
&& ./cleanup.sh \
175-
&& rm -rf ./taballs \
174+
&& rm -rf *~ taballs *.tar.xz \
176175
&& rm -rf /tmp/*
177176

178177
ENV PATH $PATH:/home/rust/osxcross/target/bin

0 commit comments

Comments
 (0)