This commit is contained in:
2026-03-24 09:56:42 -07:00
parent f9a39d5ff9
commit 599c38ac26
3 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
name: Docker
on:
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Gitea container registry
uses: docker/login-action@v3
with:
registry: git.betalupi.com
username: ${{ gitea.actor }}
password: ${{ secrets.DEPLOY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: git.betalupi.com/mark/pile:latest
cache-from: type=registry,ref=git.betalupi.com/mark/pile:cache
cache-to: type=registry,ref=git.betalupi.com/mark/pile:cache,mode=max

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
FROM rust:1.94-bookworm AS base
#
# MARK: Build
#
FROM base AS build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates wget unzip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app/rust
COPY . .
RUN cargo build --release --workspace
RUN cargo test --release --workspace
#
# MARK: Release
#
FROM debian:bookworm AS deploy
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build \
/app/rust/target/release/pile \
/app/bin/
ENV PATH="/app/bin:$PATH"
ENV RUST_BACKTRACE=full
ENTRYPOINT [""]

View File

@@ -14,7 +14,10 @@ impl ChaChaHeaderv1 {
#[test]
fn chachaheader_size() {
assert_eq!(ChaChaHeaderv1::SIZE, std::mem::size_of::<ChaChaHeaderv1>())
assert_eq!(
ChaChaHeaderv1::SIZE,
std::mem::size_of::<ChaChaHeaderv1>() - ChaChaHeaderv1::MAGIC.len()
)
}
//