From 8a420d995f182d2bf7badaf4e69792668535183a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 20 Nov 2024 11:16:15 +0100 Subject: [PATCH] ci: add a unit-test workflow This is to make sure unit tests are run and pass oneach PR. Signed-off-by: Michael Adam --- .github/workflows/unit-test.yaml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/unit-test.yaml diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml new file mode 100644 index 00000000..1c069025 --- /dev/null +++ b/.github/workflows/unit-test.yaml @@ -0,0 +1,33 @@ +name: Unit Tests +on: + pull_request: + paths-ignore: + - 'vendor/*' + branches: + - main + - release-* + +# cancel the in-progress workflow when PR is refreshed. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + unittests: + name: unittests + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: setup go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + - name: run unit tests + run: make test