+ docs: document hybrid mode and embedding requirements in README; #45
Workflow file for this run
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/CD | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: ["v*"] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GO_VERSION: "1.25" | |
| jobs: | |
| test: | |
| name: Lint & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version-file: .golangci-lint-version | |
| args: --timeout=5m ./cmd/... ./internal/... | |
| - name: Run tests | |
| run: | | |
| go test -v -race -coverprofile=coverage.out ./... | |
| - name: Generate coverage summary | |
| run: | | |
| go tool cover -func=coverage.out | tee coverage.txt | |
| echo "## Coverage" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```text' >> "$GITHUB_STEP_SUMMARY" | |
| cat coverage.txt >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.out | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build: | |
| name: Build binaries | |
| runs-on: ubuntu-latest | |
| needs: test | |
| strategy: | |
| matrix: | |
| goos: [linux, darwin, windows] | |
| goarch: [amd64, arm64] | |
| exclude: | |
| - goos: windows | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Compute build version | |
| id: build_version | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| echo "value=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=dev-${GITHUB_SHA}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build | |
| run: | | |
| EXT="" | |
| if [ "${{ matrix.goos }}" = "windows" ]; then | |
| EXT=".exe" | |
| fi | |
| GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \ | |
| go build -ldflags="-s -w -X main.version=${{ steps.build_version.outputs.value }}" \ | |
| -o ragcli-${{ matrix.goos }}-${{ matrix.goarch }}$EXT ./cmd/ragcli | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ragcli-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: ragcli-${{ matrix.goos }}-${{ matrix.goarch }}* | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| args: release --clean --config .goreleaser.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |