From aa0bdad57533aad0b40eb726657f4adb96a6aa4e Mon Sep 17 00:00:00 2001 From: dillah92 Date: Tue, 21 Apr 2026 17:42:19 +0700 Subject: [PATCH] fix: update github actions for node 24 and tidy modules Updated workflow to combine build and test jobs, improved caching, and added Go module tidy and download steps. --- .github/workflows/build-test.yaml | 67 ++++++++++++------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 25d80f902..18d8217ff 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -1,48 +1,31 @@ -name: Test +name: Build and Test + on: - pull_request: - branches: "*" - paths: - - '**.go' - - 'go.mod' - - 'go.sum' push: - branches: - - main - - staging - paths: - - '**.go' + branches: [ "main" ] + pull_request: + branches: [ "main" ] + jobs: build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - name: Checkout code - uses: actions/checkout@v4 - - name: Build Services - run: make build/canopy-full - test: - name: Test runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.21 - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up cache - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Run Unit tests - run: make build/canopy-full && go test ./... + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: true + + - name: Clean and Tidy + run: | + go mod tidy + go mod download + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./...