-
Notifications
You must be signed in to change notification settings - Fork 6
136 lines (115 loc) · 3.58 KB
/
Copy pathci.yml
File metadata and controls
136 lines (115 loc) · 3.58 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
push:
branches:
- main
paths-ignore:
- '.beads/**'
pull_request:
branches:
- main
paths-ignore:
- '.beads/**'
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ['1.25.x', 'stable']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Run tests
run: make test
integration-test:
name: Integration Test
strategy:
fail-fast: false
matrix:
backend: [bd, br]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true
- name: Install bd
if: matrix.backend == 'bd'
run: |
curl -sSfL https://github.com/steveyegge/beads/releases/download/v0.38.0/beads_0.38.0_linux_amd64.tar.gz | tar xz -C /usr/local/bin
chmod +x /usr/local/bin/bd
- name: Install br
if: matrix.backend == 'br'
run: |
# Get latest version tag and download
VERSION_TAG=$(curl -fsSL https://api.github.com/repos/Dicklesworthstone/beads_rust/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
VERSION=${VERSION_TAG#v}
curl -fsSLO "https://github.com/Dicklesworthstone/beads_rust/releases/download/${VERSION_TAG}/br-${VERSION}-linux_amd64.tar.gz"
curl -fsSLO "https://github.com/Dicklesworthstone/beads_rust/releases/download/${VERSION_TAG}/br-${VERSION}-linux_amd64.tar.gz.sha256"
sha256sum -c "br-${VERSION}-linux_amd64.tar.gz.sha256"
tar xzf "br-${VERSION}-linux_amd64.tar.gz" -C /usr/local/bin br
chmod +x /usr/local/bin/br
- name: Verify backend binary
run: |
which ${{ matrix.backend }}
${{ matrix.backend }} --version || ${{ matrix.backend }} version || true
- name: Configure backend for tests
run: |
mkdir -p .abacus
echo 'beads:' > .abacus/config.yaml
echo ' backend: ${{ matrix.backend }}' >> .abacus/config.yaml
- name: Run integration tests
run: make test-integration VERBOSE=1
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true
- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Run linter
run: make lint
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true
- name: Build binary
run: make build
- name: Verify binary exists (Unix)
if: runner.os != 'Windows'
run: test -f ./abacus
- name: Verify binary exists (Windows)
if: runner.os == 'Windows'
run: Test-Path ./abacus.exe
shell: pwsh