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