From 3d95668b9dc0a0491d01499c2a4f807de1812024 Mon Sep 17 00:00:00 2001 From: Takanori Hirano Date: Tue, 19 Aug 2025 14:04:37 +0000 Subject: [PATCH 1/4] ci: add GitHub Actions test workflow Add automated testing workflow that runs on push and pull requests to main branch. Includes Go module caching and code coverage reporting via Codecov. --- .github/workflows/test.yaml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..02bbad1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,42 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Download dependencies + run: go mod download + + - name: Run tests + run: go test -v ./... + + - name: Run tests with coverage + run: go test -v -coverprofile=coverage.out ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 From 0cf5baec1c900d59975d599cac9c50b60f832e47 Mon Sep 17 00:00:00 2001 From: Takanori Hirano Date: Tue, 19 Aug 2025 14:07:41 +0000 Subject: [PATCH 2/4] ci: update GitHub Actions to latest versions Update actions/cache from v3 to v4 and codecov/codecov-action from v3 to v4. Consolidate test steps to run tests with coverage in single step. --- .github/workflows/test.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02bbad1..959d88b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,7 +22,7 @@ jobs: go-version: "1.23" - name: Cache Go modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -33,10 +33,7 @@ jobs: run: go mod download - name: Run tests - run: go test -v ./... - - - name: Run tests with coverage run: go test -v -coverprofile=coverage.out ./... - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 From 083acd30c7c483c49ee6dc975bb4f202b7737115 Mon Sep 17 00:00:00 2001 From: Takanori Hirano Date: Tue, 19 Aug 2025 23:12:08 +0900 Subject: [PATCH 3/4] Update .github/workflows/test.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 959d88b..afdd573 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -37,3 +37,5 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} From e0e680526bae72624b4c929d54ee6e4f8161ea5f Mon Sep 17 00:00:00 2001 From: Takanori Hirano Date: Tue, 19 Aug 2025 14:27:43 +0000 Subject: [PATCH 4/4] ci: remove Go modules cache from test workflow Remove caching step to simplify the workflow and avoid potential cache-related issues. --- .github/workflows/test.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index afdd573..5b12ce3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,14 +21,6 @@ jobs: with: go-version: "1.23" - - name: Cache Go modules - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Download dependencies run: go mod download