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