refactor: migrate to upstream tls-client and add proxy chaining #16
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, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| # Prevent concurrent workflow runs on same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| build-and-test: | |
| name: Build and Test (Go ${{ matrix.go-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| go-version: ['1.25'] | |
| include: | |
| - go-version: '1.25' | |
| race: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Run tests | |
| run: | | |
| if [ "${{ matrix.go-version }}" = "1.25" ]; then | |
| go test -v -race -coverprofile=coverage.out -covermode=atomic ./... | |
| else | |
| go test -v -short ./... | |
| fi | |
| - name: Verify module validity | |
| run: | | |
| go mod verify | |
| go build -v ./... | |
| - name: Upload coverage | |
| if: matrix.race == true | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage.out | |
| test-coverage: | |
| name: Coverage Report | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage | |
| path: . | |
| - name: Generate coverage report | |
| run: | | |
| go test -coverprofile=coverage.out -covermode=atomic ./... | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.out | |
| flags: unittests | |
| name: fingerprintproxy | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Coverage Summary | |
| run: | | |
| echo "## Coverage Summary" >> "$GITHUB_STEP_SUMMARY" | |
| go tool cover -func=coverage.out >> "$GITHUB_STEP_SUMMARY" | |
| cross-platform: | |
| name: Cross-platform Build | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go-version: ['1.25'] | |
| include: | |
| - os: ubuntu-latest | |
| artifact_suffix: '-linux-amd64' | |
| goarch: amd64 | |
| - os: macos-latest | |
| artifact_suffix: '-darwin-arm64' | |
| goarch: arm64 | |
| - os: windows-latest | |
| artifact_suffix: '-windows-amd64.exe' | |
| goarch: amd64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Build | |
| run: go build -ldflags="-s -w" -o fingerprintproxy${{ matrix.artifact_suffix }} . | |
| env: | |
| GOARCH: ${{ matrix.goarch }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fingerprintproxy${{ matrix.artifact_suffix }} | |
| path: fingerprintproxy${{ matrix.artifact_suffix }} |