From ce1fd34d3a3cf3fe13ae982b51d20863023003b0 Mon Sep 17 00:00:00 2001 From: Max Sokolovsky Date: Fri, 23 Feb 2024 12:15:06 -0500 Subject: [PATCH] Add a CI pipeline with tests and linting --- .github/workflows/tests.yaml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..d98684f --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,47 @@ +on: + push: + branches: + - main + pull_request: + branches: + - "**" + +concurrency: + group: golangci-lint-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version: "^1.22.x" + + - name: tests + run: | + go test ./... -race -cover + + lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version: "^1.22.x" + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.56 + args: --timeout=5m --config=.golangci.yaml --issues-exit-code=0