From 52717542afc2a63bb847c7d6b92318cbfdbc9d9d Mon Sep 17 00:00:00 2001 From: Albert Skalt Date: Thu, 27 Jul 2023 12:51:51 +0300 Subject: [PATCH] ci: add test workflow --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..daaba5d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +--- +name: Tests + +on: [push, pull_request, workflow_dispatch] + +jobs: + tests: + if: (github.event_name == 'push') || + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.repository) || + (github.event_name == 'workflow_dispatch') + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@master + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '1.19' + + - name: Go linter + uses: golangci/golangci-lint-action@v3 + with: + args: --config=golangci-lint.yml --out-${NO_FUTURE}format colored-line-number + skip-cache: true + + - name: Unit tests + run: | + go test -race ./...