Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): switch to new fast CI #25

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/docker.yml

This file was deleted.

28 changes: 9 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,13 @@ env:
PROFILE: release

jobs:
pre-check:
name: Security, License Check
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1

rust:
name: Build (Rust)
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: |
cargo check --all-features
cargo test --all-features
cargo build --release
uses: samply/github-workflows/.github/workflows/rust.yml@main
with:
image-prefix: "samply/"
components: '[ "prism" ]'
test-via-script: false
push-to: ${{ (github.ref_protected == true || github.event_name == 'workflow_dispatch') && 'dockerhub' || 'none' }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
28 changes: 10 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
FROM lukemathwalker/cargo-chef:latest-rust-bookworm AS chef
WORKDIR /app
FROM alpine AS chmodder
ARG TARGETARCH
ARG COMPONENT
ARG FEATURE
COPY /artifacts/binaries-$TARGETARCH$FEATURE/$COMPONENT /app/$COMPONENT
RUN chmod +x /app/*

FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin prism

FROM gcr.io/distroless/cc-debian12 AS runtime
COPY --from=builder /app/target/release/prism /usr/local/bin/
COPY ./resources ./resources
ENTRYPOINT ["/usr/local/bin/prism"]
FROM gcr.io/distroless/cc-debian12
ARG COMPONENT
COPY --from=chmodder /app/$COMPONENT /usr/local/bin/samply
ENTRYPOINT [ "/usr/local/bin/samply" ]
Loading