-
Notifications
You must be signed in to change notification settings - Fork 34
118 lines (103 loc) · 3.94 KB
/
validate.yml
File metadata and controls
118 lines (103 loc) · 3.94 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Validate
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Conventional pull request names
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
golangci-lint:
permissions:
contents: read
runs-on:
group: ubuntu-latest-large
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: Configure git for private modules
env:
GIT_AUTH_TOKEN: ${{ secrets.BOT_REPO_TOKEN }}
run: git config --global url."https://speakeasybot:${GIT_AUTH_TOKEN}@github.com".insteadOf "https://github.com"
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.4.0
args: --timeout=10m --verbose
build-test:
name: Build & Test
if: ${{ github.event.pull_request.draft == false }}
permissions:
contents: read
id-token: write
actions: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on:
group: "${{ matrix.os }}-large"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go (Linux)
if: runner.os == 'Linux'
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: Set up Go (Windows)
if: runner.os == 'Windows'
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
# Reference: https://github.com/actions/setup-go/issues/495
cache: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.9"
- name: Set up Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
with:
ruby-version: "3.2"
bundler-cache: true
- name: Set up .NET
if: runner.os == 'Windows'
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
env:
# Prevent "Unable to locate dotnet CLI" transient errors
# Reference: https://github.com/dotnet/sdk/issues/44957
DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet
with:
dotnet-version: |
5.x
6.x
8.x
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Configure git for private modules (Linux)
if: runner.os == 'Linux'
env:
GIT_AUTH_TOKEN: ${{ secrets.BOT_REPO_TOKEN }}
run: git config --global url."https://speakeasybot:${GIT_AUTH_TOKEN}@github.com".insteadOf "https://github.com"
- name: Configure git for private modules (Windows)
if: runner.os == 'Windows'
env:
GIT_AUTH_TOKEN: ${{ secrets.BOT_REPO_TOKEN }}
run: git config --global url."https://speakeasybot:${env:GIT_AUTH_TOKEN}@github.com".insteadOf "https://github.com"
- name: Build
run: go build ./...
- run: go test -json -v -timeout=20m ./... | gotestfmt
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}