Repository navigation
70 lines (69 loc) · 2.37 KB
/
Copy pathci.yml
File metadata and controls
70 lines (69 loc) · 2.37 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
63
64
65
66
67
68
69
70
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
env:
GOPRIVATE: github.com/GoCodeAlone/*
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_DB: agentidentity_test
POSTGRES_USER: agentidentity_test
POSTGRES_PASSWORD: isolated-test-only
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U agentidentity_test -d agentidentity_test"
--health-interval 5s --health-timeout 5s --health-retries 10
env:
AGENTIDENTITY_TEST_DATABASE_URL: postgres://agentidentity_test:isolated-test-only@127.0.0.1:5432/agentidentity_test?sslmode=disable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure Git for private repos
env:
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: |
if [ -n "$RELEASES_TOKEN" ]; then
git config --global url."https://x-access-token:${RELEASES_TOKEN}@github.com/".insteadOf "https://github.com/"
fi
- run: go test -race -v ./...
- run: go vet ./...
plugin-contracts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure Git for private repos
env:
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: |
if [ -n "$RELEASES_TOKEN" ]; then
git config --global url."https://x-access-token:${RELEASES_TOKEN}@github.com/".insteadOf "https://github.com/"
fi
- name: Fail fast if contract files are missing
run: |
for file in plugin.json plugin.contracts.json; do
test -f "$file" || (echo "::error::$file not found" && exit 1)
done
- name: Derive wfctl version from go.mod
id: wfctl-ver
run: |
ver=$(go list -m -f '{{.Version}}' github.com/GoCodeAlone/workflow)
echo "version=$ver" >> "$GITHUB_OUTPUT"
- uses: GoCodeAlone/setup-wfctl@bcd880980f5bbe8d192d0c20ff6279d25331f956
with:
version: ${{ steps.wfctl-ver.outputs.version }}
- name: Validate plugin contracts
run: wfctl plugin validate --file plugin.json --strict-contracts