|
4 | 4 | push: |
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
| 7 | + workflow_dispatch: |
7 | 8 |
|
8 | 9 | permissions: |
9 | 10 | contents: read |
10 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
11 | 16 | jobs: |
| 17 | + quality: |
| 18 | + name: quality |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v7.0.1 |
| 22 | + - uses: actions/setup-go@v7.0.0 |
| 23 | + with: |
| 24 | + go-version-file: go.mod |
| 25 | + cache: true |
| 26 | + - name: Check formatting |
| 27 | + shell: bash |
| 28 | + run: | |
| 29 | + files="$(gofmt -l .)" |
| 30 | + if [ -n "$files" ]; then |
| 31 | + printf '%s\n' "$files" |
| 32 | + exit 1 |
| 33 | + fi |
| 34 | + - name: Check module files |
| 35 | + run: | |
| 36 | + go mod tidy |
| 37 | + git diff --exit-code -- go.mod go.sum |
| 38 | + - name: Check release metadata |
| 39 | + run: ./scripts/check-release.sh |
| 40 | + - run: go vet ./... |
| 41 | + |
12 | 42 | test: |
| 43 | + name: test (${{ matrix.os }}) |
13 | 44 | strategy: |
| 45 | + fail-fast: false |
14 | 46 | matrix: |
15 | | - os: [ubuntu-latest, macos-latest, windows-latest] |
| 47 | + os: [ubuntu-latest, macos-latest] |
16 | 48 | runs-on: ${{ matrix.os }} |
17 | 49 | steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - - uses: actions/setup-go@v5 |
| 50 | + - uses: actions/checkout@v7.0.1 |
| 51 | + - uses: actions/setup-go@v7.0.0 |
20 | 52 | with: |
21 | | - go-version: "1.26.x" |
| 53 | + go-version-file: go.mod |
22 | 54 | cache: true |
23 | 55 | - run: go test ./... -count=1 |
24 | 56 | - run: go build ./cmd/codexfold |
| 57 | + - name: Test native FSKit cache implementation |
| 58 | + if: runner.os == 'macOS' |
| 59 | + run: ./scripts/test-native-fskit-cache.sh |
| 60 | + |
| 61 | + release-config: |
| 62 | + name: release-config |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v7.0.1 |
| 66 | + - uses: goreleaser/goreleaser-action@v7.2.3 |
| 67 | + with: |
| 68 | + distribution: goreleaser |
| 69 | + version: "~> v2" |
| 70 | + args: check |
| 71 | + |
| 72 | + windows-compile: |
| 73 | + name: windows-compile |
| 74 | + runs-on: windows-latest |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v7.0.1 |
| 77 | + - uses: actions/setup-go@v7.0.0 |
| 78 | + with: |
| 79 | + go-version-file: go.mod |
| 80 | + cache: true |
| 81 | + - name: Compile all test packages without claiming runtime validation |
| 82 | + run: go test ./... -run '^$' -count=1 |
| 83 | + - run: go build ./cmd/codexfold |
| 84 | + |
| 85 | + race: |
| 86 | + name: race |
| 87 | + runs-on: ubuntu-latest |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v7.0.1 |
| 90 | + - uses: actions/setup-go@v7.0.0 |
| 91 | + with: |
| 92 | + go-version-file: go.mod |
| 93 | + cache: true |
| 94 | + - run: go test -race ./... -count=1 |
| 95 | + |
| 96 | + cross-build: |
| 97 | + name: cross-build |
| 98 | + runs-on: ubuntu-latest |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v7.0.1 |
| 101 | + - uses: actions/setup-go@v7.0.0 |
| 102 | + with: |
| 103 | + go-version-file: go.mod |
| 104 | + cache: true |
| 105 | + - name: Build Linux and Windows artifacts |
| 106 | + shell: bash |
| 107 | + run: | |
| 108 | + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "$RUNNER_TEMP/codexfold-linux-amd64" ./cmd/codexfold |
| 109 | + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "$RUNNER_TEMP/codexfold-windows-amd64.exe" ./cmd/codexfold |
| 110 | + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -c -o "$RUNNER_TEMP/codexfold-testfs-linux.test" ./internal/testfs |
| 111 | + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go test -c -o "$RUNNER_TEMP/codexfold-testfs-windows.test.exe" ./internal/testfs |
0 commit comments