forked from gophercloud/utils
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 869 Bytes
/
unit.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
on: [push, pull_request]
name: Unit Testing
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version:
- "1.21"
env:
GO111MODULE: "on"
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- name: Setup environment
run: |
# Changing into a different directory to avoid polluting go.sum with "go get"
cd "$(mktemp -d)"
go mod init unit_tests
go install golang.org/x/tools/cmd/goimports@latest
- name: Run go vet
run: |
go vet ./...
- name: Run unit tests
run: |
go test -v ./...
- name: Check for formatting
run:
./script/format