From a7ef821ddd9dbf0fcd19fb3bd9ba8674c58b908f Mon Sep 17 00:00:00 2001 From: Brian Shao Date: Fri, 20 Feb 2026 18:22:11 -0800 Subject: [PATCH] ci: update ci workflow --- .../{integration-tests.yml => ci.yaml} | 49 +++++++++++++++++-- .github/workflows/test-suite.yml | 15 ------ .github/workflows/unit-tests.yml | 24 --------- 3 files changed, 46 insertions(+), 42 deletions(-) rename .github/workflows/{integration-tests.yml => ci.yaml} (60%) delete mode 100644 .github/workflows/test-suite.yml delete mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/ci.yaml similarity index 60% rename from .github/workflows/integration-tests.yml rename to .github/workflows/ci.yaml index f0b439e..86bdb03 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/ci.yaml @@ -1,12 +1,55 @@ -name: Integration Tests +name: CI on: workflow_call: + pull_request: + branches: [ main ] + +env: + GO_VERSION: '1.25' jobs: + lint: + name: Lint Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + + - name: Check formatting + run: gofmt -l . + + unit-tests: + name: Unit Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + + - name: Download dependencies + run: go mod download + + - name: Run unit tests + run: go test -v -race ./internal/... + integration-tests: + name: Integration Tests runs-on: ubuntu-latest - + services: postgres: image: postgres:17 @@ -29,7 +72,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.25' + go-version: ${{ env.GO_VERSION }} cache: true - name: Install sql-migrate diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml deleted file mode 100644 index 99752f2..0000000 --- a/.github/workflows/test-suite.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test Suite - -on: - pull_request: - branches: [ main ] - push: - branches: [ main ] - -jobs: - unit-tests: - uses: ./.github/workflows/unit-tests.yml - - integration-tests: - needs: unit-tests - uses: ./.github/workflows/integration-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 9a695fe..0000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Unit Tests - -on: - workflow_call: - -jobs: - unit-tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.25' - cache: true - - - name: Download dependencies - run: go mod download - - - name: Run unit tests - run: go test -v -race ./internal/...