Skip to content

Commit

Permalink
ci: add Windows check Github Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cafferychen777 committed Dec 31, 2024
1 parent b1dd795 commit 002c44f
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/windows-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Windows Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
windows-check:
runs-on: windows-latest
strategy:
matrix:
r-version: ['4.3', '4.4']

steps:
- uses: actions/checkout@v3

- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}

- name: Install Rtools
uses: r-lib/actions/setup-rtools@v2
if: runner.os == 'Windows'

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.r-version }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.r-version }}-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Check package
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Test installation
run: |
install.packages(".", repos = NULL, type = "source")
library(MicrobiomeStat)
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.r-version }}-results
path: check

0 comments on commit 002c44f

Please sign in to comment.