From 325af2177a45bdc5334095f3f252fa4cf40553a9 Mon Sep 17 00:00:00 2001 From: Scott Lewis-Kelly Date: Wed, 4 Dec 2024 10:52:39 +0900 Subject: [PATCH] test: Migrate test workflow to GitHub Actions (#16) --- .circleci/config.yml | 29 ----------------------------- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 606a53d..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 -jobs: - test: - working_directory: /go/src/go.mercari.io/go-dnscache - docker: - - image: golang:1.21-bullseye - steps: - - checkout - - run: - name: Run go get - command: | - go get ./... - - run: - name: Run go vet - command: | - go vet ./... - - run: - name: Run unit tests and measure coverage - command: | - go test -v -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./... - -workflows: - version: 2 - test: - jobs: - - test: - filters: - branches: - only: /.*/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dad0f59 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Test +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + paths: + - ".github/workflows/test.yml" + - "go.*" + - "*.go" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + test: + name: test + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - name: Set up Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: ./go.mod + - name: test + run: go test -v -race ./... + - name: vet + run: go vet ./...