From bc8e27563f573e42525c2300ab616f4978391e67 Mon Sep 17 00:00:00 2001 From: Catherine Fang Date: Wed, 10 Jan 2024 10:37:12 -0500 Subject: [PATCH] Add CI build and unit-test for custom-metrics-stackdriver-adapter --- .github/workflows/ci.yaml | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..2e6d781bf --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,63 @@ +name: continuous-integration + +on: + push: + branches: + - master + tags: + - v0.* + pull_request: + branches: + - master + +permissions: + contents: read + +env: + SUDO: sudo + GO_VERSION: "^1.21" + +jobs: + ci-unit-tests-custom-metrics-stackdriver-adapter: + name: ci-unit-tests-custom-metrics-stackdriver-adapter + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + id: go + + - name: Setup environment + run: | + make install-tools + + - name: Unit tests + run: | + cd custom-metrics-stackdriver-adapter: + make test-unit + + ci-build-custom-metrics-stackdriver-adapter: + name: ci-build-custom-metrics-stackdriver-adapter + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + id: go + + - name: Setup environment + run: | + make install-tools + + - name: Build + run: | + cd custom-metrics-stackdriver-adapter: + make build