-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 940 Bytes
/
pkg-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
name: pkg - CI
on:
pull_request:
branches:
- main
paths:
- pkg/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
changed:
name: Prepare
uses: ./.github/workflows/changes.yml
with:
path: pkg
test:
name: Test (${{ matrix.module }})
needs: [changed]
runs-on: ubuntu-latest
if: needs.changed.outputs.any_changed == 'true'
strategy:
matrix:
go-version: ['1.21.x']
module: ${{ fromJSON(needs.changed.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: pkg/${{ matrix.module }}/go.sum
- name: Test
working-directory: pkg/${{ matrix.module }}
run: go test ./...