Skip to content

Commit 1ff82a3

Browse files
authored
workflows: Combine vet steps (#124)
* workflows: Combine vet steps * Update tests.yml * workflows: Fix err
1 parent a66b98f commit 1ff82a3

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3-
41
name: Run
52

63
on:
@@ -16,34 +13,21 @@ jobs:
1613
matrix:
1714
go: [ '1.23', '1' ]
1815
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v4
21-
22-
- name: Set up Go
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: ${{ matrix.go }}
26-
27-
- name: Vet
28-
run: go vet -v ./...
29-
30-
- name: Test
31-
run: go test -v ./...
32-
33-
adapters:
34-
runs-on: ubuntu-latest
3516
steps:
3617
- uses: actions/checkout@v4
3718

3819
- name: Set up Go
3920
uses: actions/setup-go@v5
4021
with:
41-
go-version: '1.23'
22+
go-version: ${{ matrix.go }}
4223

4324
- name: Vet
44-
run: find ./adapters -type f -name "go.mod" -exec dirname {} \; | while read -r dir; do (cd "$dir" && go vet ./...) done
25+
run: go vet -v ./...
4526

46-
_examples:
27+
- name: Test
28+
run: go test -v ./...
29+
30+
adapters_and_examples:
4731
runs-on: ubuntu-latest
4832
steps:
4933
- uses: actions/checkout@v4
@@ -53,5 +37,16 @@ jobs:
5337
with:
5438
go-version: '1.23'
5539

56-
- name: Vet
57-
run: find ./_examples -type f -name "go.mod" -exec dirname {} \; | while read -r dir; do (cd "$dir" && go vet ./...) done
40+
- name: Vet Adapters
41+
run: |
42+
find ./adapters -type f -name "go.mod" -exec dirname {} \; | while read -r dir; do
43+
echo "Running go vet in $dir"
44+
(cd "$dir" && go vet ./...)
45+
done
46+
47+
- name: Vet Examples
48+
run: |
49+
find ./_examples -type f -name "go.mod" -exec dirname {} \; | while read -r dir; do
50+
echo "Running go vet in $dir"
51+
(cd "$dir" && go vet ./...)
52+
done

0 commit comments

Comments
 (0)