github.com/mavryk-network/mvgo@v1.19.9/.github/workflows/build.yml (about) 1 name: Build and run test 2 3 on: 4 pull_request: 5 push: 6 branches: 7 - master 8 9 jobs: 10 build: 11 runs-on: ubuntu-latest 12 strategy: 13 matrix: 14 go-version: [ '1.19', '1.20', '1.21', '1.22' ] 15 16 steps: 17 - uses: actions/checkout@v4 18 - name: Setup Go 19 uses: actions/setup-go@v5 20 with: 21 go-version: ${{ matrix.go-version }} 22 - name: Install dependencies 23 run: go get ./... 24 - name: Run gofmt 25 run: | 26 if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then 27 echo "Some files are not correctly formatted. Run 'gofmt -l -w'." 28 exit 1 29 fi 30 - name: Run golangci-lint 31 uses: golangci/golangci-lint-action@v6 32 with: 33 version: v1.60.3 34 - name: Build 35 run: go build -v ./... 36 - name: Test with Go 37 run: go test -json ./... > TestResults-${{ matrix.go-version }}.json 38 - name: Upload Go test results 39 uses: actions/upload-artifact@v4 40 with: 41 name: Go-results-${{ matrix.go-version }} 42 path: TestResults-${{ matrix.go-version }}.json