Skip to content
Open
Changes from all 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
27 changes: 22 additions & 5 deletions .github/workflows/go-ci-cd.yaml → .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ on:
branches: ["main"]

jobs:
lint:
check-changes:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
backend:
- '!frontend/**'

lint-backend:
name: Vet
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.backend == 'true'
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -22,16 +37,18 @@ jobs:
- name: Run Go Vet
run: go vet ./...

test:
test-backend:
name: Test
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.backend == 'true'
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24" # Specify your desired Go version
go-version: "1.24"

- name: Install dependencies
run: |
Expand All @@ -41,10 +58,10 @@ jobs:
- name: Run tests
run: go test -v ./...

build:
build-backend:
name: Build
runs-on: ubuntu-latest
needs: [test, lint] # Ensure tests and linting pass before building
needs: [test-backend, lint-backend]
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down