Merge pull request #36 from cfoust/caleb/07-08-25/chore/golangci-lint #369
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: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.24" | |
| - name: Install zsh | |
| # This is used for the TestDefaultShell test | |
| run: sudo apt-get install -qqy zsh libx11-dev just | |
| - name: Generate and format code | |
| run: | | |
| go generate ./cmd/... ./pkg/... | |
| go fmt ./cmd/... ./pkg/... | |
| git add . | |
| git diff HEAD | |
| git diff-index --quiet --cached HEAD -- | |
| - name: Lint | |
| run: | | |
| just lint | |
| - name: Build | |
| run: go build -v ./cmd/cy/. | |
| - name: Test | |
| run: go test -v ./pkg/... ./cmd/... | |
| - name: Install latest mdbook | |
| run: | | |
| tag="v0.4.35" | |
| url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | |
| mkdir mdbook | |
| curl -sSL $url | tar -xz --directory=./mdbook | |
| echo `pwd`/mdbook >> $GITHUB_PATH | |
| - name: Build book | |
| run: | | |
| cd docs | |
| # Building all of the assets for the docs site takes a while; we only | |
| # build it on release. This is just to verify that this PR/commit did | |
| # not break any documentation. | |
| CY_SKIP_ASSETS=1 mdbook build |