|
| 1 | +# Workflow optimized for Windows I/O performance |
| 2 | +# Insights from: https://chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, master, dev] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +name: R-CMD-check (Windows) |
| 9 | + |
| 10 | +permissions: read-all |
| 11 | + |
| 12 | +jobs: |
| 13 | + R-CMD-check: |
| 14 | + runs-on: windows-latest |
| 15 | + |
| 16 | + name: windows-latest (release) |
| 17 | + |
| 18 | + env: |
| 19 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 20 | + R_KEEP_PKG_SOURCE: yes |
| 21 | + # Move R library and temp files to the faster Dev Drive (mounted as R: below) |
| 22 | + R_LIBS_USER: R:\R\library |
| 23 | + TMP: R:\temp |
| 24 | + TEMP: R:\temp |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Setup Dev Drive |
| 28 | + uses: samypr100/setup-dev-drive@v3 |
| 29 | + with: |
| 30 | + drive-letter: "R" |
| 31 | + size: "10GB" |
| 32 | + |
| 33 | + - name: Create directories on Dev Drive |
| 34 | + run: | |
| 35 | + mkdir R:\R\library -Force |
| 36 | + mkdir R:\temp -Force |
| 37 | + shell: pwsh |
| 38 | + |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + # Checkout directly into the Dev Drive |
| 42 | + path: 'R:\repo' |
| 43 | + |
| 44 | + # Update workspace to point to the Dev Drive |
| 45 | + # This ensures subsequent steps run in the faster storage |
| 46 | + - name: Change workspace |
| 47 | + run: | |
| 48 | + echo "GITHUB_WORKSPACE=R:\repo" >> $env:GITHUB_ENV |
| 49 | + shell: pwsh |
| 50 | + |
| 51 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 52 | + |
| 53 | + - uses: r-lib/actions/setup-r@v2 |
| 54 | + with: |
| 55 | + r-version: "release" |
| 56 | + use-public-rspm: true |
| 57 | + |
| 58 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 59 | + with: |
| 60 | + extra-packages: any::rcmdcheck |
| 61 | + needs: check |
| 62 | + # Ensure working directory is correctly set for the action |
| 63 | + working-directory: R:\repo |
| 64 | + |
| 65 | + - name: Run R CMD check |
| 66 | + uses: r-lib/actions/check-r-package@v2 |
| 67 | + with: |
| 68 | + upload-snapshots: true |
| 69 | + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
| 70 | + working-directory: R:\repo |
0 commit comments