Skip to content

Commit

Permalink
Try to optimize GitHub Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicEric committed Feb 2, 2025
1 parent ff92595 commit 7b706a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ permissions:

env:
RUST_MSRV: 1.82.0
CARGO_INCREMENTAL: 0
CARGO_PROFILE_TEST_DEBUG: 0

jobs:
rustfmt:
Expand All @@ -30,6 +32,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
- name: Run Clippy
run: |
rustup component add clippy
Expand All @@ -41,22 +44,24 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
rustup toolchain install ${RUST_MSRV}-x86_64-unknown-linux-gnu
rustup override set ${RUST_MSRV}-x86_64-unknown-linux-gnu
cargo build
cargo build --locked
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
- name: Test
run: |
cargo install cargo-llvm-cov
cargo llvm-cov --verbose --codecov --output-path codecov.json
cargo llvm-cov --verbose --codecov --locked --output-path codecov.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ COPY Cargo.toml Cargo.lock .
RUN mkdir src \
&& echo "fn main() {}" > src/main.rs \
&& cargo fetch \
&& cargo zigbuild --release --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl \
&& cargo zigbuild --release --locked --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl \
&& rm src/main.rs
COPY src ./src
COPY README.md .
RUN cargo zigbuild --release --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl
RUN cargo zigbuild --release --locked --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl

FROM --platform=$BUILDPLATFORM scratch AS binary
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/sandhole /sandhole-linux-amd64
Expand Down

0 comments on commit 7b706a2

Please sign in to comment.