From 97eaa364aed074b13a4abf29f4b2fcf4c44da7c3 Mon Sep 17 00:00:00 2001 From: DevITWay Date: Mon, 26 Jan 2026 08:17:57 +0000 Subject: [PATCH] ci: split workflows - CI for tests, Release for tags only --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 8 +------- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c22569b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - name: Check formatting + run: cargo fmt --check + + - name: Clippy + run: cargo clippy --package nora-registry -- -D warnings + + - name: Run tests + run: cargo test --package nora-registry diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d29bfb..564ae16 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,10 +2,7 @@ name: Release on: push: - branches: [main] tags: ['v*'] - pull_request: - branches: [main] env: REGISTRY: ghcr.io @@ -31,7 +28,6 @@ jobs: name: Build & Push runs-on: ubuntu-latest needs: test - if: github.event_name != 'pull_request' permissions: contents: read packages: write @@ -58,11 +54,10 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha,prefix= + type=raw,value=latest - name: Build and push uses: docker/build-push-action@v5 @@ -79,7 +74,6 @@ jobs: name: GitHub Release runs-on: ubuntu-latest needs: build - if: startsWith(github.ref, 'refs/tags/v') permissions: contents: write