From 77fc969d9757716b1db543ebba8653ba39da2c71 Mon Sep 17 00:00:00 2001 From: Haitao Chen Date: Tue, 28 May 2024 01:11:47 -0700 Subject: [PATCH] golang workflows for restful (#550) * go test workflow * dependbot update * target v3 branch * use v3 branch --- .github/dependabot.yml | 18 ++++++++++++++++++ .github/workflows/go.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/go.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0701279 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: gomod # See documentation for possible values + target-branch: v3 + directory: / # Location of package manifests + schedule: + interval: weekly + + - package-ecosystem: github-actions + target-branch: v3 + directory: / + schedule: + interval: weekly \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..442e283 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,36 @@ +name: Go + +on: + push: + branches: [ "v3" ] + pull_request: + branches: [ "v3" ] + +permissions: + contents: read + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + with: + egress-policy: audit + + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: 1.21 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Codecov + uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1