name: Code Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *' workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
FALKORDB_HOST: 127.0.0.1
FALKORDB_PORT: 6379
jobs:
coverage:
runs-on: ubuntu-latest
services:
falkordb:
image: falkordb/falkordb:edge
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
- name: Install redis-cli
run: |
sudo apt-get update
sudo apt-get install -y redis-tools
- name: Wait for FalkorDB to be ready
run: |
echo "Waiting for FalkorDB to be ready..."
for i in {1..30}; do
if redis-cli -h 127.0.0.1 -p 6379 ping > /dev/null 2>&1; then
echo "FalkorDB is ready!"
break
fi
echo "Attempt $i: FalkorDB not ready yet..."
sleep 2
done
redis-cli -h 127.0.0.1 -p 6379 ping
- uses: taiki-e/install-action@88ada01c46e65c47040a0ae865537cc76fcd0e1c with:
tool: just,cargo-llvm-cov,nextest
- name: Populate test graph
run: pip install falkordb && just db-populate
- name: Generate Code Coverage
run: just coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f with:
files: codecov.json
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}