CI #25
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
| # Comprehensive testing workflow for glcm package | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| schedule: | |
| # Run every Monday at 8 AM UTC | |
| - cron: '0 8 * * 1' | |
| name: CI | |
| permissions: read-all | |
| jobs: | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_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, any::testthat | |
| needs: coverage | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgdal-dev libproj-dev libgeos-dev libudunits2-dev | |
| - name: Test coverage | |
| run: | | |
| covr::codecov( | |
| quiet = FALSE, | |
| clean = FALSE | |
| ) | |
| shell: Rscript {0} | |
| - name: Show testthat output | |
| if: always() | |
| run: | | |
| ## -------------------------------------------------------------------- | |
| find . -name 'testthat.Rout*' -exec cat '{}' \; || true | |
| find . -name '*.Rcheck' -type d -exec find {} -name 'testthat.Rout*' -exec cat {} \; \; || true | |
| shell: bash | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-test-failures | |
| path: | | |
| *.Rcheck/ | |
| check/ | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_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::lintr, local::. | |
| needs: lint | |
| - name: Lint | |
| run: lintr::lint_package() | |
| shell: Rscript {0} | |
| document: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::roxygen2, local::. | |
| needs: roxygen2 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgdal-dev libproj-dev libgeos-dev libudunits2-dev | |
| - name: Document | |
| run: roxygen2::roxygenise() | |
| shell: Rscript {0} | |
| - name: Check if documentation is up to date | |
| run: | | |
| if [[ -n $(git status --porcelain) ]]; then | |
| echo "Documentation is out of date. Please run roxygen2::roxygenise() and commit the changes." | |
| git status --porcelain | |
| exit 1 | |
| fi | |
| spell-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_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::spelling, local::. | |
| needs: spelling | |
| - name: Check spelling | |
| run: | | |
| spelling::spell_check_package() | |
| shell: Rscript {0} |