feat: harden cross-platform backends, add IsNonCritical, testable CLI #33
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: Go | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go: ['1.22', 'stable'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run tests with coverage (Unix) | |
| if: runner.os != 'Windows' | |
| run: go test -v -count=1 -coverprofile=coverage.out ./... | |
| - name: Run tests (Windows) | |
| if: runner.os == 'Windows' | |
| run: go test -v -count=1 ./... | |
| - name: Upload coverage | |
| if: matrix.os == 'ubuntu-latest' && matrix.go == 'stable' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.out | |
| fail_ci_if_error: false | |
| build-cli: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| binary: sysproxy-linux-amd64 | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: arm64 | |
| binary: sysproxy-linux-arm64 | |
| - os: macos-latest | |
| goos: darwin | |
| goarch: arm64 | |
| binary: sysproxy-darwin-arm64 | |
| - os: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| binary: sysproxy-windows-amd64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| - name: Build CLI | |
| env: | |
| CGO_ENABLED: '0' | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: go build -o dist/${{ matrix.binary }} ./cmd/sysproxy | |
| - name: Upload CLI artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.binary }} | |
| path: dist/${{ matrix.binary }} | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.11.4 | |
| args: --timeout=5m | |
| ci: | |
| runs-on: ubuntu-latest | |
| needs: [test, build-cli, lint] | |
| steps: | |
| - run: echo "All checks passed" |