Skip to content

Commit

Permalink
Move to official Rust Alpine Docker image
Browse files Browse the repository at this point in the history
The previous image appears to be mostly unmaintained:
emk/rust-musl-builder#147
  • Loading branch information
shepmaster committed Nov 20, 2022
1 parent dacb49a commit e2bb55c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ jobs:
args: "--manifest-path top-crates/Cargo.toml --check"
- name: Build backend
run: |-
mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/home/rust/.cargo/git -v ~/.cargo/registry:/home/rust/.cargo/registry --workdir /ui ekidd/rust-musl-builder:stable bash -c $'
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry --workdir /ui rust:alpine bash -c $'
apk add musl-dev openssl-dev
# Unit tests
cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
cargo test --locked --no-run;
test_bin=$(find target/debug/deps/ -type f -perm -a=x);
mv "${test_bin}" target/unit_tests;
# Primary binary
cargo build --locked --target=x86_64-unknown-linux-musl --release;
mv target/x86_64-unknown-linux-musl/release/ui target/ui;
cargo build --locked --release;
mv target/release/ui target/ui;
'
- name: Restore permissions
run: sudo chown -R runner:docker ~/.cargo/ ui/target
Expand Down
16 changes: 8 additions & 8 deletions ci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,21 @@ workflows:
run
--rm
-v $PWD/ui:/ui
-v ~/.cargo/git:/home/rust/.cargo/git
-v ~/.cargo/registry:/home/rust/.cargo/registry
-v ~/.cargo/git:/root/.cargo/git
-v ~/.cargo/registry:/root/.cargo/registry
--workdir /ui
ekidd/rust-musl-builder:stable
rust:alpine
bash -c $'
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
apk add musl-dev openssl-dev
# Unit tests
cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
cargo test --locked --no-run;
test_bin=$(find target/debug/deps/ -type f -perm -a=x);
mv "${test_bin}" target/unit_tests;
# Primary binary
cargo build --locked --target=x86_64-unknown-linux-musl --release;
mv target/x86_64-unknown-linux-musl/release/ui target/ui;
cargo build --locked --release;
mv target/release/ui target/ui;
'
- name: "Restore permissions"
Expand Down

0 comments on commit e2bb55c

Please sign in to comment.