feat: Add windows specific build workflow #1
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
| # Workflow optimized for Windows I/O performance | |
| # Insights from: https://chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you | |
| on: | |
| push: | |
| branches: [main, master, dev] | |
| pull_request: | |
| name: R-CMD-check (Windows) | |
| permissions: read-all | |
| jobs: | |
| R-CMD-check: | |
| runs-on: windows-latest | |
| name: windows-latest (release) | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| # Move R library and temp files to the faster Dev Drive (mounted as R: below) | |
| R_LIBS_USER: R:\R\library | |
| TMP: R:\temp | |
| TEMP: R:\temp | |
| steps: | |
| - name: Setup Dev Drive | |
| uses: samypr100/setup-dev-drive@v3 | |
| with: | |
| drive-letter: "R" | |
| size: "10GB" | |
| - name: Create directories on Dev Drive | |
| run: | | |
| mkdir R:\R\library -Force | |
| mkdir R:\temp -Force | |
| shell: pwsh | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Checkout directly into the Dev Drive | |
| path: 'R:\repo' | |
| # Update workspace to point to the Dev Drive | |
| # This ensures subsequent steps run in the faster storage | |
| - name: Change workspace | |
| run: | | |
| echo "GITHUB_WORKSPACE=R:\repo" >> $env:GITHUB_ENV | |
| shell: pwsh | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: "release" | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::rcmdcheck | |
| needs: check | |
| # Ensure working directory is correctly set for the action | |
| working-directory: R:\repo | |
| - name: Run R CMD check | |
| uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| upload-snapshots: true | |
| build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' | |
| working-directory: R:\repo |