-
Notifications
You must be signed in to change notification settings - Fork 1.4k
62 lines (53 loc) · 1.88 KB
/
Copy pathunit-genkit-go.yml
File metadata and controls
62 lines (53 loc) · 1.88 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
name: unit
on:
push:
branches: [main]
paths:
- "integrations/community/genkit/go/**"
- ".github/workflows/unit-genkit-go.yml"
pull_request:
branches: [main]
paths:
- "integrations/community/genkit/go/**"
- ".github/workflows/unit-genkit-go.yml"
permissions:
contents: read
jobs:
go-genkit:
name: Go Genkit Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false
- name: Detect fork PR
id: fork-check
run: |
if [[ "${{ github.event_name }}" == "pull_request" && \
"${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}" != "${{ github.repository }}" ]]; then
echo "prefix=fork-" >> "$GITHUB_OUTPUT"
else
echo "prefix=" >> "$GITHUB_OUTPUT"
fi
env:
GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.0"
- name: Setup Go module cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ steps.fork-check.outputs.prefix }}${{ runner.os }}-go-genkit-${{ hashFiles('integrations/community/genkit/go/genkit/go.sum') }}
restore-keys: |
${{ steps.fork-check.outputs.prefix }}${{ runner.os }}-go-genkit-
- name: Download dependencies
working-directory: integrations/community/genkit/go/genkit
run: go mod download
- name: Run tests
working-directory: integrations/community/genkit/go/genkit
run: go test ./... -v