|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: |
| 4 | + - master |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +name: test-coverage |
| 10 | + |
| 11 | +jobs: |
| 12 | + test-coverage-mac: |
| 13 | + name: "Mac" |
| 14 | + if: "! contains(github.event.head_commit.message, '[ci skip]')" |
| 15 | + runs-on: macOS-latest |
| 16 | + env: |
| 17 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - uses: r-lib/actions/setup-r@master |
| 22 | + |
| 23 | + - uses: r-lib/actions/setup-pandoc@master |
| 24 | + |
| 25 | + - name: Query dependencies |
| 26 | + run: | |
| 27 | + install.packages('remotes') |
| 28 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 29 | + shell: Rscript {0} |
| 30 | + |
| 31 | + - name: Cache R packages |
| 32 | + uses: actions/cache@v1 |
| 33 | + with: |
| 34 | + path: ${{ env.R_LIBS_USER }} |
| 35 | + key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }} |
| 36 | + restore-keys: macOS-r-4.0-1- |
| 37 | + |
| 38 | + - name: Install dependencies |
| 39 | + run: | |
| 40 | + install.packages(c("remotes")) |
| 41 | + remotes::install_deps(dependencies = TRUE) |
| 42 | + remotes::install_cran("covr") |
| 43 | + shell: Rscript {0} |
| 44 | + |
| 45 | + - name: Test coverage |
| 46 | + run: covr::codecov() |
| 47 | + shell: Rscript {0} |
| 48 | + |
| 49 | + test-coverage-windows: |
| 50 | + name: "Windows" |
| 51 | + if: "! contains(github.event.head_commit.message, '[ci skip]')" |
| 52 | + runs-on: windows-latest |
| 53 | + env: |
| 54 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v2 |
| 57 | + |
| 58 | + # - name: Set path for RTools 4.0 |
| 59 | + # if: runner.os == 'Windows' |
| 60 | + # run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 |
| 61 | + # |
| 62 | + # - name: Install mingw32-make and check toolchain path |
| 63 | + # if: runner.os == 'Windows' |
| 64 | + # run: | |
| 65 | + # pacman -Syu mingw-w64-x86_64-make --noconfirm |
| 66 | + # g++ --version |
| 67 | + # Get-Command g++ | Select-Object -ExpandProperty Definition |
| 68 | + # mingw32-make --version |
| 69 | + # Get-Command mingw32-make | Select-Object -ExpandProperty Definition |
| 70 | + # shell: powershell |
| 71 | + |
| 72 | + - uses: r-lib/actions/setup-r@master |
| 73 | + with: |
| 74 | + r-version: 'release' |
| 75 | + |
| 76 | + - uses: r-lib/actions/setup-pandoc@master |
| 77 | + |
| 78 | + - name: Query dependencies |
| 79 | + run: | |
| 80 | + install.packages('remotes') |
| 81 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 82 | + shell: Rscript {0} |
| 83 | + |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + install.packages(c("remotes")) |
| 87 | + remotes::install_deps(dependencies = TRUE) |
| 88 | + remotes::install_cran("covr") |
| 89 | + shell: Rscript {0} |
| 90 | + |
| 91 | + - name: Test coverage |
| 92 | + run: covr::codecov() |
| 93 | + shell: Rscript {0} |
| 94 | + |
| 95 | + # - name: Test coverage |
| 96 | + # run: | |
| 97 | + # options(covr.gcov = 'C:/rtools40/mingw64/bin/gcov.exe'); |
| 98 | + # covr::codecov(type = "all") |
| 99 | + # shell: Rscript {0} |
0 commit comments