From dd830412481e69ef928c5ee24699ddca30e33269 Mon Sep 17 00:00:00 2001 From: Daniel Adam Date: Tue, 5 Sep 2023 12:12:13 +0200 Subject: [PATCH] Add GitHub test with go 1.18 Added to ensure that go 1.18 works until its support is dropped. --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce818160..ac6d338c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,3 +62,29 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + test1_18: + # don't run for forks + 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-latest + + steps: + - name: Set up Go 1.18 + uses: actions/setup-go@v4 + with: + # Go 1.18 is required by coap-gateway-go1-18 in https://github.com/plgd-dev/hub/blob/main/.github/workflows/publishDockerImagesGhcr.yml + go-version: "~1.18" + + - run: go version + + - name: Checkout + uses: actions/checkout@v4 + + - name: Run a build + run: go build ./... + + - name: Run a test + run: go test -v -race ./... -coverpkg=./... -covermode=atomic -coverprofile=./coverage.txt