Merge pull request #6 from Jesssullivan/docs/phase8-progress #66
This file contains hidden or 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
| # GitHub Actions workflow for R CMD check | |
| # Secondary CI pipeline (primary is GitLab CI) | |
| name: R-CMD-check | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| R-CMD-check: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {os: ubuntu-latest, r: 'release'} | |
| - {os: ubuntu-latest, r: 'devel'} | |
| - {os: macos-latest, r: 'release'} | |
| - {os: windows-latest, r: 'release'} | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| defaults: | |
| run: | |
| working-directory: packages/gnucashr | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| http-user-agent: ${{ matrix.config.http-user-agent }} | |
| use-public-rspm: true | |
| - name: Install Linux system dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libtbb-dev libsqlite3-dev | |
| working-directory: . | |
| - name: Install macOS system dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install harfbuzz fribidi freetype tbb sqlite3 | |
| working-directory: . | |
| # macOS: use base R install.packages to avoid pak binary download failures | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| Rscript -e ' | |
| options( | |
| repos = c(CRAN = "https://cloud.r-project.org"), | |
| pkgType = "source", | |
| Ncpus = 4 | |
| ) | |
| # Install remotes for dependency resolution | |
| install.packages("remotes", type = "source") | |
| # Install package dependencies from source | |
| remotes::install_deps(dependencies = TRUE, type = "source", upgrade = "never") | |
| # Install rcmdcheck | |
| install.packages("rcmdcheck", type = "source") | |
| ' | |
| shell: bash | |
| - name: Install dependencies (non-macOS) | |
| if: runner.os != 'macOS' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::rcmdcheck | |
| needs: check | |
| cache-version: 8 | |
| working-directory: packages/gnucashr | |
| env: | |
| PKGCACHE_HTTP_VERSION: 2 | |
| PKGCACHE_TIMEOUT: 600 | |
| - uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| upload-snapshots: true | |
| args: 'c("--no-manual", "--as-cran")' | |
| build_args: 'c("--no-manual")' | |
| error-on: '"warning"' | |
| working-directory: packages/gnucashr | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| name: Test coverage | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| defaults: | |
| run: | |
| working-directory: packages/gnucashr | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| working-directory: packages/gnucashr | |
| - name: Test coverage | |
| run: | | |
| covr::codecov( | |
| quiet = FALSE, | |
| clean = FALSE, | |
| install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"), | |
| line_exclusions = list("src/RcppExports.cpp") | |
| ) | |
| shell: Rscript {0} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Show testthat output | |
| if: always() | |
| run: | | |
| find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | |
| shell: bash |