I suppose?
Some checks failed
Build and push container image / build (push) Has been cancelled

This commit is contained in:
toast 2024-01-08 02:51:59 +11:00
parent f4b5423bd4
commit 3f52c785c3
3 changed files with 21 additions and 36 deletions

View File

@ -31,7 +31,25 @@ jobs:
id: restore-cache id: restore-cache
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: docker-buildx-kon key: docker-buildx-kon-
- name: Cache cargo registry
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
@ -49,4 +67,4 @@ jobs:
id: cache id: cache
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: docker-buildx-kon key: docker-buildx-kon-${{ github.sha }}

View File

@ -1,31 +0,0 @@
name: Cache Rust dependencies
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04-node
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
- name: Cache cargo registry
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build -r --verbose

View File

@ -2,10 +2,8 @@ FROM rust:1.75-alpine3.19@sha256:8eaab14d138f0d61240da09aeadb87fcd9c2593975b8852
ENV RUSTFLAGS="-C target-feature=-crt-static" ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add --no-cache openssl-dev musl-dev RUN apk add --no-cache openssl-dev musl-dev
WORKDIR /usr/src/kon WORKDIR /usr/src/kon
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build -r && rm -rf src
COPY . . COPY . .
RUN --mount=type=cache,target=/tmp/.buildx-cache/kon-cargo cargo fetch && cargo build -r RUN cargo fetch && cargo build -r
FROM alpine:3.19@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 FROM alpine:3.19@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48
RUN apk add --no-cache openssl-dev libgcc RUN apk add --no-cache openssl-dev libgcc