feat: add tui console and release hardening #30
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" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| permissions: | |
| contents: read | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.10' | |
| cache: true | |
| - name: Run tests | |
| run: go test -coverprofile=coverage.out ./... | |
| - name: Run vet | |
| run: go vet ./... | |
| - name: Run race tests | |
| run: go test -race ./cmd ./pkg/session ./pkg/accesspolicy ./pkg/publicauth ./pkg/k8s ./pkg/clusterconnect ./pkg/tunnel | |
| - name: Install gosec | |
| run: go install github.com/securego/gosec/v2/cmd/gosec@v2.22.8 | |
| - name: Run gosec | |
| run: $(go env GOPATH)/bin/gosec ./cmd ./pkg/... ./assets ./ | |
| - name: Check npm package builder syntax | |
| run: node --check scripts/build-npm-packages.mjs | |
| - name: Upload coverage profile | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: go-coverage | |
| path: coverage.out | |
| goreleaser-snapshot: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.10' | |
| cache: true | |
| - name: Run GoReleaser snapshot | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: '~> v2' | |
| args: release --snapshot --clean | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
| - name: Resolve build version | |
| id: vars | |
| run: echo "version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build Docker image | |
| uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | |
| with: | |
| context: . | |
| push: false | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:ci-${{ github.sha }} | |
| build-args: | | |
| VERSION=${{ steps.vars.outputs.version }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |