Prepare for first submission to CRAN #254
Workflow file for this run
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
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
push: | |
branches: main | |
paths: | | |
- R/** | |
- tests/** | |
- man/** | |
- vignettes/** | |
pull_request: | |
branches: main | |
name: test-coverage | |
env: | |
PGHOST: localhost | |
PGPORT: 5432 | |
PGDATABASE: diseasystore_test | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
jobs: | |
test-coverage: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: diseasystore_test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::covr | |
needs: coverage | |
- name: Setup testing schemata in PostgreSQL | |
run: | | |
psql diseasystore_test -c "CREATE SCHEMA test_ds; CREATE SCHEMA not_test_ds;" | |
- name: Test coverage | |
run: | | |
covr::codecov( | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") | |
) | |
shell: Rscript {0} | |
- name: Show testthat output | |
if: always() | |
run: | | |
## -------------------------------------------------------------------- | |
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload test results | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-test-failures | |
path: ${{ runner.temp }}/package |