-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add Coveralls coverage report to CI (#403)
* ci: add Coveralls coverage report to CI * ci: add pgrx setup steps * fix ubuntu version to 20.04
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Code Coverage | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
code-coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.81.0 | ||
components: llvm-tools-preview | ||
|
||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- run: | | ||
sudo apt remove -y postgres* | ||
sudo apt-get install -y wget gnupg | ||
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
sudo apt-get update -y -qq --fix-missing | ||
sudo apt-get install -y \ | ||
clang-10 \ | ||
llvm-10 \ | ||
clang \ | ||
gcc \ | ||
make \ | ||
build-essential \ | ||
libz-dev \ | ||
zlib1g-dev \ | ||
strace \ | ||
libssl-dev \ | ||
pkg-config \ | ||
postgresql-15 \ | ||
postgresql-server-dev-15 | ||
sudo chmod a+rwx `/usr/lib/postgresql/15/bin/pg_config --pkglibdir` `/usr/lib/postgresql/15/bin/pg_config --sharedir`/extension /var/run/postgresql/ | ||
- run: cargo install cargo-pgrx --version 0.12.7 | ||
- run: cargo pgrx init --pg15 /usr/lib/postgresql/15/bin/pg_config | ||
|
||
- name: Generate code coverage | ||
id: coverage | ||
run: | | ||
cargo llvm-cov test --workspace --exclude supabase-wrappers-macros --no-fail-fast --lcov --output-path lcov.info | ||
- name: Coveralls upload | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: lcov.info | ||
debug: true |