Initial commit: Ncode SDK for Linux #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| name: ${{ matrix.os }} / Go ${{ matrix.go }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # go-fitz uses cgo + MuPDF; ubuntu-latest ships gcc & mesa headers. | |
| # macOS / windows runners are not validated as part of the CI | |
| # baseline because the production code path also requires Mono + | |
| # NeoLABNcodeSDK.dll, which CI cannot provision. Cross-build is | |
| # exercised in a separate job below. | |
| os: [ubuntu-latest] | |
| go: ["1.25"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| cache: true | |
| - name: gofmt | |
| run: | | |
| out=$(gofmt -l .) | |
| if [ -n "$out" ]; then | |
| echo "::error::gofmt found unformatted files:" | |
| echo "$out" | |
| exit 1 | |
| fi | |
| - name: go vet | |
| run: go vet ./... | |
| - name: go test | |
| run: go test ./... -timeout 5m | |
| cross-build: | |
| name: cross-build / ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Compile-only cross-targets. Cgo is disabled here since the | |
| # baseline runner doesn't have cross toolchains for MuPDF; this | |
| # exercises the non-pdf packages on every supported GOOS/GOARCH. | |
| target: | |
| - linux/amd64 | |
| - linux/arm64 | |
| - darwin/arm64 | |
| - windows/amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| cache: true | |
| - name: build (no-cgo subset) | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| CGO_ENABLED: "0" | |
| run: | | |
| os=${TARGET%/*} | |
| arch=${TARGET#*/} | |
| GOOS=$os GOARCH=$arch go build ./ncode/... ./pattern/... ./examples/discover-tickets/... |