forked from Chaotic-Logic/terraform-provider-discord
-
Notifications
You must be signed in to change notification settings - Fork 20
43 lines (43 loc) · 1.08 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
cache: true
go-version-file: go.mod
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Generate docs
shell: bash
run: go generate ./...
- name: Check for documentation changes
shell: bash
run: |
result=0
git diff --compact-summary --exit-code || result=$?
if [ ! "$result" -eq "0" ]; then
echo
echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."
exit 1
fi