github.com/stripe/stripe-go/v76@v76.25.0/.github/workflows/ci.yml (about)

     1  name: CI
     2  
     3  on:
     4    # Allows you to run this workflow manually from the Actions tab
     5    workflow_dispatch: {}
     6    push:
     7      branches:
     8        - master
     9        - beta
    10        - sdk-release/**
    11        - feature/**
    12      tags:
    13        - v[0-9]+.[0-9]+.[0-9]+*
    14    pull_request:
    15      branches:
    16        - master
    17        - beta
    18        - sdk-release/**
    19        - feature/**
    20  
    21  jobs:
    22    lint:
    23      name: Lint
    24  
    25      runs-on: ubuntu-latest
    26  
    27      steps:
    28        - uses: actions/checkout@master
    29  
    30        - name: Setup go
    31          uses: actions/setup-go@v1
    32          with:
    33            go-version: "1.19"
    34  
    35        - name: lint
    36          run: |
    37            go install honnef.co/go/tools/cmd/staticcheck@latest &&
    38            go install golang.org/x/tools/cmd/goimports@latest &&
    39            $HOME/go/bin/staticcheck &&
    40            make vet &&
    41            make check-gofmt
    42  
    43    test:
    44       runs-on: ubuntu-latest
    45       strategy:
    46         matrix:
    47           go:
    48             - "1.19"
    49             - "1.18"
    50             - "1.17"
    51             - "1.16"
    52             - "1.15"
    53       name: "Test: go v${{ matrix.go }}"
    54       steps:
    55         - uses: actions/checkout@v2
    56         - name: Setup go
    57           uses: actions/setup-go@v1
    58           with:
    59             go-version: ${{ matrix.go }}
    60         - uses: stripe/openapi/actions/stripe-mock@master
    61         - name: Test
    62           run: make ci-test
    63         - name: Coveralls
    64           run: make coverage && make coveralls
    65           if: matrix.go == '1.16'
    66           env:
    67             COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    68             COVERALLS_FLAG_NAME: Go-${{ matrix.go }}
    69  
    70    publish:
    71      name: Publish
    72      if: >-
    73        (github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
    74        startsWith(github.ref, 'refs/tags/v') &&
    75        endsWith(github.actor, '-stripe')
    76      runs-on: ubuntu-latest
    77      steps:
    78        - uses: actions/checkout@v2
    79        - uses: stripe/openapi/actions/notify-release@master
    80          if: always()
    81          with:
    82            bot_token: ${{ secrets.SLACK_BOT_TOKEN }}