| name: Go |
| |
| on: |
| push: |
| branches: [ main ] |
| pull_request: |
| branches: [ main ] |
| |
| env: |
| TZ: Asia/Shanghai |
| |
| jobs: |
| build: |
| name: Build |
| runs-on: ${{ matrix.os }} |
| strategy: |
| matrix: |
| os: [macos-latest, ubuntu-latest, windows-latest] |
| steps: |
| |
| - name: Set up Go 1.x |
| uses: actions/setup-go@v2 |
| with: |
| go-version: ^1.13 |
| |
| - name: Check out code into the Go module directory |
| uses: actions/checkout@v2 |
| |
| - name: Get dependencies |
| run: | |
| go get -v -t -d ./... |
| |
| - name: Build |
| run: go build -v ./... |
| |
| - name: Set timezone |
| if : matrix.os == 'windows-latest' |
| run: | |
| tzutil /g |
| tzutil /s "China Standard Time" |
| tzutil /g |
| shell: cmd |
| |
| - name: Test |
| run: go test -v ./... |