Skip to content

Commit

Permalink
Merge pull request #122 from furrer-lab/120-mac-based-testing
Browse files Browse the repository at this point in the history
on label install check mac & windows
  • Loading branch information
j-i-l committed Jul 10, 2024
2 parents ead6eee + ceef3ca commit ec1f05e
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 3,016 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/onlabel_CRAN_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ jobs:
run: |
renv::deactivate()
shell: Rscript {0}
- name: Change permissions of configure
- name: Configure ABN for installation
run: |
chmod +x configure
shell: bash
autoconf
- name: Install package dependencies
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never')
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/onlabel_Macos_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Workflow is triggered on label and check installation on various operating systems
# This action is adapted from https://github.com/t4d-gmbh/stubbed_versioning
name: On Label Macos Checks

on:
pull_request:
types: [ labeled ]

env:
LABEL_CHECK: 'macos::check'
LABEL_SUCCESS: 'macos::passed'
LABEL_FAILURE: 'macos::failed'
BUILD_LOC: "./build"

permissions:
packages: read
contents: write
pull-requests: write
repository-projects: write

jobs:
R-CMD-check:
if: ${{ github.event.label.name == 'macos::check' }}
name: macos-latest (${{ matrix.config.r }})
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
strategy:
fail-fast: false
matrix:
config:
- {r: 'release',}
# - {r: '4.1',}
# - {r: 'devel', http-user-agent: 'release'}
# - {r: 'oldrel-1',}
# - {r: 'oldrel-2',}
# - {r: 'oldrel-3',}

steps:
- name: install dependencies macos
run: |
brew install pkg-config
brew install gsl
brew install jags
brew install automake # needed to run autoconf
gsl-config --libs
gsl-config --cflags
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: install rjags separately
run: |
install.packages('rjags', configure.args = '--enable-rpath')
shell: Rscript {0}

- name: Configure ABN for installation
run: |
autoconf
- name: Debugging
run: |
pkg-config --cflags --static jags
pkg-config --libs --static jags
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: false
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

report_macos_checks:
if: ${{ (success() || failure()) }}
needs:
- R-CMD-check
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.R-CMD-check.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.R-CMD-check.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.R-CMD-check.outcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
120 changes: 120 additions & 0 deletions .github/workflows/onlabel_Windows_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Workflow is triggered on label and check installation on various operating systems
# This action is adapted from https://github.com/t4d-gmbh/stubbed_versioning
name: On Label Windows Checks

on:
pull_request:
types: [ labeled ]

env:
LABEL_CHECK: 'windows::check'
LABEL_SUCCESS: 'windows::passed'
LABEL_FAILURE: 'windows::failed'
BUILD_LOC: "./build"
JAGS_MAJORV: '4'
JAGS_VERSION: '4.3.1'
JAGS_URL: "https://sourceforge.net/projects/mcmc-jags/files/JAGS"

permissions:
packages: read
contents: write
pull-requests: write
repository-projects: write

jobs:
R-CMD-check:
if: ${{ github.event.label.name == 'windows::check' }}
name: windows-latest (${{ matrix.config.r }})
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
strategy:
fail-fast: false
matrix:
config:
- {r: 'release',}
# - {r: '4.1',}
- {r: 'devel', http-user-agent: 'release'}
- {r: 'oldrel-1',}
- {r: 'oldrel-2',}
# - {r: 'oldrel-3',}

steps:

- name: Install GSL binaries with cygwin
uses: cygwin/cygwin-install-action@master

- name: Install JAGS
run: |
Import-Module bitstransfer
New-Item -ItemType Directory -Force -Path "C:\Program Files\JAGS\JAGS-${{ env.JAGS_VERSION }}"
start-bitstransfer -source ${{ env.JAGS_URL }}/${{ env.JAGS_MAJORV }}.x/Windows/JAGS-${{ env.JAGS_VERSION }}.exe/download "C:\Program Files\JAGS\JAGS-${{ env.JAGS_VERSION }}\JAGS-${{ env.JAGS_VERSION }}.exe"
Start-Process -Wait -FilePath "C:\Program Files\JAGS\JAGS-${{ env.JAGS_VERSION }}\JAGS-${{ env.JAGS_VERSION }}.exe" -ArgumentList "/S" -PassThru
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: install JAGS
run: |
Sys.setenv(JAGS_HOME="C:/Program Files/JAGS/JAGS-${{ env.JAGS_VERSION }}")
install.packages("rjags")
shell: Rscript {0}

- name: install JAGS
run: |
install.packages("INLA", repos = c(getOption("repos"), INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: false
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

report_windows_checks:
if: ${{ (success() || failure()) }}
needs:
- R-CMD-check
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.R-CMD-check.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.R-CMD-check.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.R-CMD-check.outcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
Loading

0 comments on commit ec1f05e

Please sign in to comment.