Use license file for integration tests (#228) #511
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
name: test-coverage | |
jobs: | |
test-coverage: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RSC_VERSION: 2022.09.0 | |
RSC_LICENSE: ${{ secrets.RSC_LICENSE }} | |
CONNECT_LICENSE_FILE: ${{ secrets.CONNECT_LICENSE_FILE }} | |
CONNECTAPI_INTEGRATED: true | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- 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, local::. | |
needs: coverage | |
- name: Set up license file | |
run: echo "$CONNECT_LICENSE_FILE" > $RSC_LICENSE | |
- name: Setup test environment | |
run: | | |
connectapi:::build_test_env() | |
shell: Rscript {0} | |
- name: Test coverage | |
id: coverage | |
run: | | |
system(paste0("echo ::set-output name=OUTDIR::", Sys.getenv("R_SESSION_TMPDIR"))) | |
tryCatch({ | |
covr::codecov(clean = FALSE, quiet = FALSE) | |
}, error = function(e) { | |
message(e) | |
}) | |
fs::dir_copy(Sys.getenv("R_SESSION_TMPDIR"), "/tmp/outputs") | |
shell: Rscript {0} | |
- name: Archive tempdir artifacts | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: tmpdir artifacts | |
path: | | |
/tmp/outputs |