2020-05-05 14:13:48 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
name: Code coverage
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
grcov:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
postgres:
|
2020-12-27 16:35:05 +03:00
|
|
|
image: postgis/postgis:13-3.1-alpine
|
2020-05-05 14:13:48 +03:00
|
|
|
env:
|
|
|
|
POSTGRES_DB: test
|
|
|
|
POSTGRES_USER: postgres
|
2020-12-27 16:35:05 +03:00
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
2020-05-05 14:13:48 +03:00
|
|
|
ports:
|
|
|
|
- 5432/tcp
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup database
|
|
|
|
run: |
|
|
|
|
sudo apt-get install postgresql-client
|
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/TileBBox.sql
|
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/table_source.sql
|
2021-04-24 20:19:37 +03:00
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/points1_source.sql
|
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/points2_source.sql
|
2020-05-05 14:13:48 +03:00
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/function_source.sql
|
2021-07-16 12:09:18 +03:00
|
|
|
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U postgres -d test -f tests/fixtures/function_source_query_params.sql
|
2020-05-05 14:13:48 +03:00
|
|
|
env:
|
|
|
|
POSTGRES_HOST: localhost
|
|
|
|
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
|
|
|
|
|
|
|
- name: Install nightly toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --all
|
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
|
|
|
|
DATABASE_URL: postgres://postgres@localhost:${{ job.services.postgres.ports[5432] }}/test
|
|
|
|
|
|
|
|
- name: Gather coverage data
|
|
|
|
id: coverage
|
|
|
|
uses: actions-rs/grcov@v0.1
|
|
|
|
|
|
|
|
- name: Codecov upload
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
file: ${{ steps.coverage.outputs.report }}
|