Continuous Integration

Most Qlty users user Qlty Cloud, our fully automated Code Health Platform, to run static analysis in the cloud, making CI setup unnecessary. However, there are a few use cases where running Qlty CLI in your continuous integration (CI) pipeline is useful.

Auto-formatting your code nightly

Qlty Cloud does not currently support auto-formatting your code. However, you can run qlty fmt in your CI pipeline to automatically format your code nightly.

Here is an example GitHub Actions workflow:

.github/workflows/fmt.yml
1name: fmt
2
3on:
4 workflow_dispatch:
5 schedule:
6 - cron: "0 6 * * *"
7
8permissions:
9 contents: write
10
11jobs:
12 format:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v4
16 with:
17 ref: ${{ github.head_ref }}
18
19 - uses: qltysh/qlty-action/fmt@main
20
21 - name: Commit changes
22 uses: stefanzweifel/git-auto-commit-action@v5
23 with:
24 commit_message: qlty fmt --all
25 branch: ${{ github.head_ref }}
26 commit_user_name: qltysh[bot]
27 commit_user_email: 168846912+qltysh[bot]@users.noreply.github.com
28 commit_author: qltysh[bot] <168846912+qltysh[bot]@users.noreply.github.com>

Publishing code coverage data to Qlty Cloud

Qlty CLI is used to publish code coverage data to Qlty Cloud. Please see our documentation for setting up code coverage for more information.