# Continuous integration: every pull request and every push to main must pass # the linter, the build and the tests. Packaging lives in package.yml, which # only runs when the version file changes. name: CI on: pull_request: push: branches: [main] workflow_dispatch: # A new push on the same branch supersedes the previous run, but main builds run # to completion so a broken merge is always reported. concurrency: group: ci-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: check: # Arch Linux host runner: kitty builds against the Arch toolchain (base-devel, # go, python, harfbuzz, shader-slang...) and makepkg refuses to run as root. runs-on: arch-host defaults: run: shell: bash steps: - uses: actions/checkout@v4 - name: Check the version files agree run: ./packaging/check-version.sh - name: Lint Python run: | ruff check . ruff format --check . - name: Check Go formatting run: | # Generated files only exist after ./dev.sh build and are not tracked, # so only the committed sources are checked. unformatted="$(git ls-files -z '*.go' | xargs -0 gofmt -s -l)" if [ -n "$unformatted" ]; then echo "::error::gofmt is required for:" echo "$unformatted" exit 1 fi - name: Build run: ./dev.sh build # The Go packages import generated code and embedded data produced by the # build above, so vet and tests cannot run on a bare checkout. - name: Vet run: go vet ./kittens/file_manager/ - name: Test run: go test --tags testing ./kittens/file_manager/ - name: Smoke test the binaries run: | ./kitty/launcher/kitty --version ./kitty/launcher/kitten --version