Repository navigation
111 lines (102 loc) · 3.01 KB
/
Copy pathci.yml
File metadata and controls
111 lines (102 loc) · 3.01 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Check formatting
shell: bash
run: |
files="$(gofmt -l .)"
if [ -n "$files" ]; then
printf '%s\n' "$files"
exit 1
fi
- name: Check module files
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Check release metadata
run: ./scripts/check-release.sh
- run: go vet ./...
test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
cache: true
- run: go test ./... -count=1
- run: go build ./cmd/codexfold
- name: Test native FSKit cache implementation
if: runner.os == 'macOS'
run: ./scripts/test-native-fskit-cache.sh
release-config:
name: release-config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: goreleaser/goreleaser-action@v7.2.3
with:
distribution: goreleaser
version: "~> v2"
args: check
windows-compile:
name: windows-compile
runs-on: windows-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Compile all test packages without claiming runtime validation
run: go test ./... -run '^$' -count=1
- run: go build ./cmd/codexfold
race:
name: race
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
cache: true
- run: go test -race ./... -count=1
cross-build:
name: cross-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Build Linux and Windows artifacts
shell: bash
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "$RUNNER_TEMP/codexfold-linux-amd64" ./cmd/codexfold
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "$RUNNER_TEMP/codexfold-windows-amd64.exe" ./cmd/codexfold
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -c -o "$RUNNER_TEMP/codexfold-testfs-linux.test" ./internal/testfs
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go test -c -o "$RUNNER_TEMP/codexfold-testfs-windows.test.exe" ./internal/testfs