Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Rust build artifacts
**/*.rs.bk
*.pdb

# Docker specific
Dockerfile*
docker-compose*
.docker/

# Git and version control
.git*

# Documentation
/docs

# Project build files
Cargo.lock
**/.cargo-ok

# Test artifacts
**/*test-*
**/*Test*

# Editor configs
.editorconfig

/target
/.idea
*~
Thumbs.db
.DS*
/.vscode/*.log
.*~
4 changes: 0 additions & 4 deletions .gitea/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ on: [push, pull_request]

name: Continuous integration for Rust

env:
RUSTUP_UPDATE_ROOT: "https://mirrors.cernet.edu.cn/rustup/rustup"
RUSTUP_DIST_SERVER: "https://mirrors.cernet.edu.cn/rustup"

jobs:
check:
name: Check the code with cargo check
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create and publish a Docker image

on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.short-sha.outputs.sha }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
8 changes: 5 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# File Created: 2025-03-05 11:10:40
#
# Modified By: mingcheng ([email protected])
# Last Modified: 2025-03-05 17:42:51
# Last Modified: 2025-03-18 14:54:55
##

name: Cargo Build & Test
Expand All @@ -34,7 +34,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup component add clippy && cargo clippy -- -D warnings
- run: rustup component add rustfmt && cargo fmt --all -- --check
- run: rustup component add clippy --toolchain ${{ matrix.toolchain }}
- run: rustup component add rustfmt --toolchain ${{ matrix.toolchain }}
- run: cargo clippy -- -D warnings
- run: cargo fmt --all -- --check
- run: cargo build --verbose
- run: cargo test --verbose
Loading