From 91dcda2c6828a32ff45d6e01d971adab510f9fd9 Mon Sep 17 00:00:00 2001 From: Saeid Date: Mon, 22 May 2023 05:38:39 +0200 Subject: [PATCH] ci: added build & test jobs (#121) Co-authored-by: Saeid Saeidee --- .github/workflows/tests.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..55c8605 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: tests + +on: + push: + branches: + - '**' + - '*' + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + run-tests: + strategy: + matrix: + go: ['1.19', '1.18', '1.17'] + platform: [ubuntu-latest] + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + # Run build of the application + - name: Run build + run: go build . + + - name: Run tests + run: go test -race -count=1 -v ./...