unused argument #317
This file contains 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 derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
name: R-CMD-check | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "master" | |
env: | |
cache-version: "cache-v1" | |
jobs: | |
R-CMD-check: | |
strategy: | |
matrix: | |
config: | |
- { os: ubuntu-latest } | |
- { os: macos-latest } # disabling until https://github.com/r-lib/actions/issues/950 is resolved | |
- { os: windows-latest } | |
runs-on: ${{ matrix.config.os }} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup R and Bioconductor | |
uses: grimbough/bioc-actions/setup-bioc@v1 | |
id: install-r | |
with: | |
bioc-version: devel | |
- name: Install ubuntu dependencies | |
if: ${{ matrix.config.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update && sudo apt-get install -y libgsl-dev | |
- name: Install macos dependencies | |
if: ${{ matrix.config.os == 'macos-latest' }} | |
run: | | |
brew install gsl | |
- name: Get R version | |
id: R | |
run: | | |
R --version > VERSION | |
echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT | |
rm VERSION | |
shell: bash -l {0} | |
- name: Get Bioconductor version | |
id: BIOC | |
run: | | |
echo "version=$R_BIOC_VERSION" >> $GITHUB_OUTPUT | |
shell: bash -l {0} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Cache R packages | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/work/_temp/Library | |
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}- | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
- uses: r-lib/actions/check-r-package@v2 | |
- name: Check if actor has permission | |
if: matrix.config.os == 'ubuntu-latest' | |
id: check_permissions | |
run: | | |
# Define allowed actors | |
ALLOWED_ACTORS=("zktuong" "Jiawei-Yu10") # Replace these with the actual GitHub usernames | |
if [[ " ${ALLOWED_ACTORS[@]} " =~ " ${GITHUB_ACTOR} " ]]; then | |
echo "has_permission=true" >> $GITHUB_OUTPUT | |
else | |
echo "has_permission=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Debug permissions output | |
run: | | |
echo "Has permission: ${{ steps.check_permissions.outputs.has_permission }}" | |
- name: Setup to test coverage | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
if: steps.check_permissions.outputs.has_permission == 'true' && matrix.config.os == 'ubuntu-latest' | |
with: | |
packages: covr | |
- name: Test coverage | |
if: steps.check_permissions.outputs.has_permission == 'true' && matrix.config.os == 'ubuntu-latest' | |
run: | | |
Rscript -e 'covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}")' | |
shell: bash -l {0} |