github.com/alwitt/goutils@v0.6.4/.github/workflows/cicd.yaml (about)

     1  name: CICD
     2  
     3  on:
     4    push:
     5      branches:
     6        - main
     7    pull_request:
     8      branches:
     9        - main
    10    workflow_dispatch:
    11  
    12  jobs:
    13    golint:
    14      runs-on: ubuntu-latest
    15  
    16      steps:
    17        - uses: actions/checkout@v3
    18  
    19        - name: golint
    20          uses: Jerome1337/golint-action@v1.0.2
    21          with:
    22            golint-path: "./..."
    23  
    24    golangci-lint:
    25      runs-on: ubuntu-latest
    26  
    27      steps:
    28        - uses: actions/checkout@v3
    29  
    30        - name: golangci-lint
    31          uses: golangci/golangci-lint-action@v3
    32          with:
    33            version: v1.51.2
    34            args: --timeout 3m0s
    35  
    36    test:
    37      runs-on: ubuntu-latest
    38  
    39      steps:
    40        - uses: actions/checkout@v3
    41  
    42        - name: Set up Go
    43          uses: actions/setup-go@v4
    44          with:
    45            go-version: "1.20"
    46  
    47        - name: Test
    48          env:
    49            UNITTEST_GCP_PROJECT_ID: cicd-389504
    50            GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp-creds.json
    51            GOOGLE_APPLICATION_CREDENTIALS_VAL: ${{ secrets.GOOGLEAPPLICATIONCREDENTIALSVAL }}
    52          run: |
    53            echo "$GOOGLE_APPLICATION_CREDENTIALS_VAL" > /tmp/gcp-creds.json
    54            go test --count 1 -v -timeout 600s -short ./...