diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index a9cd9ad..c011917 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -10,6 +10,15 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + - name: Find go version + run: | + GO_VERSION=$(awk '/^go/ {print $2};' go.mod) + echo "::set-output name=version::${GO_VERSION}" + id: awk_gomod + - name: Ensure go version + uses: actions/setup-go@v2 + with: + go-version: "${{ steps.awk_gomod.outputs.version }}" - name: run tests run: go test -json ./... > test.json - name: Annotate tests