github.com/Ptt-official-app/go-bbs@v0.12.0/.github/workflows/tests.yml (about) 1 name: Tests 2 3 on: 4 push: { } 5 pull_request: { } 6 workflow_dispatch: { } 7 8 jobs: 9 lint: 10 name: Lint 11 strategy: 12 matrix: 13 os: 14 - macos-latest 15 - ubuntu-latest 16 - windows-latest 17 go-version: 18 - ^1.16 19 runs-on: ${{ matrix.os }} 20 steps: 21 - uses: actions/checkout@v2 22 - name: golangci-lint 23 uses: golangci/golangci-lint-action@v2 24 with: 25 version: v1.37 26 27 build: 28 name: Build and test 29 strategy: 30 matrix: 31 os: 32 - macos-latest 33 - ubuntu-latest 34 - windows-latest 35 go: 36 - ^1.16 37 runs-on: ${{ matrix.os }} 38 steps: 39 - name: Setup Go ${{ matrix.go }} 40 uses: actions/setup-go@v2 41 with: 42 go-version: ${{ matrix.go }} 43 44 - name: Checkout source code into the current working directory 45 uses: actions/checkout@v2 46 47 - name: Cache Go Modules 48 uses: actions/cache@v2 49 with: 50 path: ~/go/pkg/mod 51 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 52 restore-keys: | 53 ${{ runner.os }}-go- 54 55 - name: Test 56 run: go test -v ./... 57 58 - name: Build 59 run: go build -v ./...