github.com/rosedblabs/rosedb/v2@v2.3.7-0.20240423093736-a89ea823e5b9/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      branches: [ main ]
     6    pull_request:
     7      branches: [ main ]
     8  
     9  jobs:
    10  
    11    ubuntu-test:
    12      runs-on: ubuntu-latest
    13      steps:
    14        - uses: actions/checkout@v2
    15  
    16        - name: Set up Go
    17          uses: actions/setup-go@v2
    18          with:
    19            go-version: 1.19
    20  
    21        - name: Run Go Vet
    22          run: |
    23            go vet ./...
    24  
    25        - name: Run Go Fmt
    26          run: |
    27            files=$(go fmt ./...)
    28            if [ -n "$files" ]; then
    29              echo "Please run gofmt on these files ..."
    30              echo "$files"
    31              exit 1
    32            fi
    33  
    34        - name: Build
    35          run: go build -v
    36  
    37        - name: Run Unit Test
    38          run: go test -count 1 -v ./...
    39  
    40        - name: Run Benchmark Test
    41          working-directory: ./benchmark
    42          run: go test -count 1 -v -bench=. ./...
    43  
    44    windows-test:
    45      runs-on: windows-latest
    46      steps:
    47        - uses: actions/checkout@v2
    48  
    49        - name: Set up Go
    50          uses: actions/setup-go@v2
    51          with:
    52            go-version: 1.19
    53  
    54        - name: Run Go Vet
    55          run: |
    56            go vet ./...
    57  
    58        - name: Build
    59          run: go build -v
    60  
    61        - name: Run Unit Test
    62          run: go test -count 1 -v ./...
    63  
    64        - name: Run Benchmark Test
    65          working-directory: ./benchmark
    66          run: go test -count 1 -v -bench=. ./...