R package for downloading OpenStreetMap data
at main 66 lines 1.8 kB view raw
1on: 2 push: 3 branches: 4 - main 5 pull_request: 6 branches: 7 - main 8 9name: test-coverage 10 11permissions: read-all 12 13jobs: 14 15 test-coverage: 16 17 runs-on: ubuntu-latest 18 19 env: 20 GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 21 22 steps: 23 - uses: actions/checkout@v4 24 25 - uses: r-lib/actions/setup-r@v2 26 with: 27 use-public-rspm: true 28 29 - uses: r-lib/actions/setup-r-dependencies@v2 30 with: 31 extra-packages: any::covr, any::xml2 32 needs: coverage 33 34 - name: Test coverage 35 run: | 36 cov <- covr::package_coverage( 37 quiet = FALSE, 38 clean = FALSE, 39 install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"), 40 line_exclusions = list('R/overpass-query.R', 'src/rapidxml.h','src/rapidxml_print.h'),function_exclusions=c('osm_elevation','check_elev_file') 41 ) 42 covr::to_cobertura(cov) 43 shell: Rscript {0} 44 45 - uses: codecov/codecov-action@v4 46 with: 47 # Fail if error if not on PR, or if on PR and token is given 48 fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} 49 file: ./cobertura.xml 50 plugin: noop 51 disable_search: true 52 token: ${{ secrets.CODECOV_TOKEN }} 53 54 - name: Show testthat output 55 if: always() 56 run: | 57 ## -------------------------------------------------------------------- 58 find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true 59 shell: bash 60 61 - name: Upload test results 62 if: failure() 63 uses: actions/upload-artifact@v4 64 with: 65 name: coverage-test-failures 66 path: ${{ runner.temp }}/package