refactor: redesign flow and the TUI #10
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.23" | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Run go fmt check | |
| run: | | |
| if [ -n "$(gofmt -l .)" ]; then | |
| echo "Some files need gofmt formatting:"; | |
| gofmt -l .; | |
| exit 1; | |
| fi | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run tests with coverage | |
| run: | | |
| go test ./... -coverprofile=coverage.out | |
| go tool cover -func=coverage.out | grep total | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage.out | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| - name: Install golangci-lint | |
| run: | | |
| mkdir -p "$HOME/go/bin" | |
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ | |
| | sh -s -- -b "$HOME/go/bin" v1.57.0 | |
| echo "$HOME/go/bin" >> $GITHUB_PATH | |
| - name: Run golangci-lint | |
| run: golangci-lint run ./... |