|
| 1 | +// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
| 2 | +// SPDX-License-Identifier: CC-BY-4.0 |
| 3 | + |
| 4 | += Continuous Integration |
| 5 | + |
| 6 | +The UnifiedDB project uses continuous integration (CI) to improve quality and automate artifact creation. |
| 7 | + |
| 8 | +We use two framworks for CI: |
| 9 | + |
| 10 | +- https://pre-commit.com[pre-commit] |
| 11 | +- https://docs.github.com/en/actions[GitHub Actions] |
| 12 | + |
| 13 | +== Frameworks |
| 14 | + |
| 15 | +=== pre-commit |
| 16 | + |
| 17 | +`pre-commit` checks are installed by the UnifiedDB setup and automatically run as a git hook on commit. |
| 18 | +Any errors from pre-commit will cause a `git commit` to fail. |
| 19 | +Most pre-commit checks (like linters) will automatically edit the offending files to fix them; |
| 20 | +just `git add` the changes and try again. |
| 21 | + |
| 22 | +`pre-commit` can also be run on demand with `./bin/pre-commit`. |
| 23 | + |
| 24 | +=== GitHub Actions |
| 25 | + |
| 26 | +The upstream UnifiedDB main branch is protected by a variety of checks. |
| 27 | +The checks are split into two different groups. |
| 28 | + |
| 29 | +==== PR Regression Tests |
| 30 | + |
| 31 | +The first group runs on any PR targeting the main branch. |
| 32 | +All of the tests must pass before the PR is allowed to move to the https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue[merge queue]. |
| 33 | +The tests are specified in xref:.github/workflows/regress.yml[`.github/workflows/regress.yml`]. |
| 34 | + |
| 35 | +==== Deployment Tests / Actions |
| 36 | + |
| 37 | +The second group of tests run when a PR enters the merge queue. |
| 38 | +They generate artifacts that are deployed to https://riscv-software-src.github.io/riscv-unified-db/[GitHub pages]. |
| 39 | +If any test in the second group fails, a PR is removed from the merge queue. |
| 40 | +While in the merge queue, the CI tests generate artifacts but do not upload/update pages yet. |
| 41 | +The upload occurs after the PR merges to main and the test runs again. |
| 42 | +The tests are specified in xref:.github/workflows/deploy.yml[`.github/workflows/deploy.yml`] and are uploaded via xref:.github/workflows/pages.yml[`.github/workflows/pages.yml`]. |
| 43 | + |
| 44 | +== CI Policies |
| 45 | + |
| 46 | +=== Test Coverage |
| 47 | + |
| 48 | +Code coverage is tracked for the `idlc` and `udb` Ruby gems. |
| 49 | +New PRs must not drop line coverage of the gems by more than 1%. |
| 50 | + |
| 51 | +While coverage is not currently tracked for other collateral, any new features are expected to be |
| 52 | +tested and those tests are expected to be run during CI. |
0 commit comments