Merge pull request #114 from amikos-tech/codex/evaluate-concurrent-to… #156
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 CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - '.github/workflows/go-ci.yml' | |
| - '.github/workflows/go-security.yml' | |
| - '.github/actions/**' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - '.github/workflows/go-ci.yml' | |
| - '.github/workflows/go-security.yml' | |
| - '.github/actions/**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| go-test: | |
| name: Go Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go-version: ['1.24'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Setup Rust (for fallback builds) | |
| uses: ./.github/actions/setup-rust | |
| - name: Run Go linting | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| - name: Get Rust library | |
| uses: ./.github/actions/get-rust-library | |
| with: | |
| github-token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| - name: Run Go tests (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| go mod tidy | |
| go test -v -coverprofile=coverage.out -timeout=30m ./... | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Run Go tests (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| go mod tidy | |
| go test -v -timeout=30m ./... | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| go-security: | |
| uses: ./.github/workflows/go-security.yml | |
| with: | |
| go-version: '1.24' | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [go-test, go-security] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Setup Rust (for fallback builds) | |
| uses: ./.github/actions/setup-rust | |
| - name: Get Rust library | |
| uses: ./.github/actions/get-rust-library | |
| with: | |
| github-token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| - name: Test download functionality | |
| run: | | |
| go test -v -run "TestDownloadFunctionality|TestGetLibraryInfo" | |
| - name: Test library loading | |
| run: | | |
| go test -v -run "TestGetCachedLibraryPath|TestCacheDirectory" | |
| huggingface-integration: | |
| name: HuggingFace Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [go-test, go-security] | |
| # Only run on main branch or when PR has 'integration' label | |
| if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'integration') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Setup Rust (for fallback builds) | |
| uses: ./.github/actions/setup-rust | |
| - name: Get Rust library | |
| uses: ./.github/actions/get-rust-library | |
| with: | |
| github-token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| - name: Run HuggingFace integration tests | |
| run: | | |
| go test -v -tags=integration -run "TestHFIntegration" -timeout=60m | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| GITHUB_TOKEN: ${{ github.token }} |