github.com/gogf/gf@v1.16.9/.github/workflows/go.yml (about)

     1  name: GoFrame CI
     2  
     3  on:
     4    push:
     5      branches:
     6        - 'master'
     7        - 'develop'
     8        - 'fix/unsafe'
     9    pull_request:
    10      branches: ['master', 'develop','fix/**']
    11  env:
    12    GF_DEBUG: 1
    13  
    14  jobs:
    15    code-test:
    16      runs-on: ubuntu-latest
    17      # Service containers to run with `code-test`
    18      services:
    19        redis:
    20          image: redis
    21          options: >-
    22            --health-cmd      "redis-cli ping"
    23            --health-interval 10s
    24            --health-timeout  5s
    25            --health-retries  5
    26          ports:
    27            # Maps tcp port 6379 on service container to the host
    28            - 6379:6379
    29        mysql:
    30          image: mysql:5.7
    31          env:
    32            MYSQL_DATABASE: test
    33            MYSQL_ROOT_PASSWORD: 12345678
    34          ports:
    35            # Maps tcp port 3306 on service container to the host
    36            - 3306:3306
    37  
    38      # strategy set
    39      strategy:
    40        matrix:
    41          go: [ "1.15", "1.16", "1.17" ]
    42  
    43      steps:
    44        - name: Set Up Timezone
    45          uses: szenius/set-timezone@v1.0
    46          with:
    47            timezoneLinux: "Asia/Shanghai"
    48  
    49        - name: Checkout Repositary
    50          uses: actions/checkout@v2
    51  
    52        - name: Set Up Go
    53          uses: actions/setup-go@v2
    54          with:
    55            go-version: ${{ matrix.go }}
    56  
    57        - name: Before Script
    58          run: |
    59            date
    60            find . -name "*.go" | xargs gofmt -w
    61            git diff --name-only --exit-code || exit 1
    62            sudo echo "127.0.0.1   local" | sudo tee -a /etc/hosts
    63  
    64        - name: Run i386 Arch Test
    65          run: GOARCH=386 go test -v ./... || exit 1
    66  
    67        - name: Run amd64 Arch Test
    68          run: GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
    69  
    70        - name: Report Coverage
    71          run: bash <(curl -s https://codecov.io/bash)
    72