Compare commits
2
Commits
2f7d825ca5
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b18d81421 | ||
|
|
b15072e12d |
+15
-10
@@ -1,8 +1,11 @@
|
||||
name: PR Check
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: forgejo.riotpiao.com
|
||||
@@ -11,26 +14,28 @@ env:
|
||||
SQLX_OFFLINE: "true"
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Build, Test & Image
|
||||
ci:
|
||||
name: CI
|
||||
runs-on: rust
|
||||
steps:
|
||||
- name: Install Docker
|
||||
run: apt-get update && apt-get install -y docker.io
|
||||
- name: Install Node.js and Docker
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y nodejs docker.io
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cargo build
|
||||
- name: Cargo build all
|
||||
run: cargo build --all --verbose
|
||||
|
||||
- name: Cargo test
|
||||
- name: Cargo test all
|
||||
run: cargo test --all --lib --verbose 2>&1 | tail -150 || true
|
||||
|
||||
- name: Cargo clippy
|
||||
run: cargo clippy --all --all-targets -- -D warnings 2>&1 | tail -50 || true
|
||||
|
||||
- name: Clean build artifacts
|
||||
- name: Clean build artifacts before Docker
|
||||
run: cargo clean
|
||||
|
||||
- name: Get short SHA
|
||||
@@ -45,7 +50,7 @@ jobs:
|
||||
REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }}
|
||||
REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push image (SHA tag only)
|
||||
- name: Build and push Docker image (SHA tag only)
|
||||
run: |
|
||||
docker build --no-cache --progress=plain \
|
||||
-t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \
|
||||
@@ -53,5 +58,5 @@ jobs:
|
||||
docker push "${IMAGE}:${{ steps.sha.outputs.short_sha }}"
|
||||
echo "Pushed: ${IMAGE}:${{ steps.sha.outputs.short_sha }}"
|
||||
|
||||
- name: Prune images
|
||||
- name: Prune unused images
|
||||
run: docker image prune -a --force 2>&1 | tail -3 || true
|
||||
|
||||
Reference in New Issue
Block a user