Skip to content

Commit

Permalink
Amended all ymls files
Browse files Browse the repository at this point in the history
  • Loading branch information
anitaapplegarth committed Nov 1, 2024
1 parent fc7fa33 commit 5ccb207
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 72 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install matplotlib numpy>=1.8 packaging parameterized pandas>=1.4 tqdm
# Install pyEpiabm in development mode to ensure it's in PYTHONPATH
git clone https://github.com/SABS-R3-Epidemiology/epiabm.git
cd epiabm
pip install -e .
cd ..
python -m pip install git+https://github.com/SABS-R3-Epidemiology/epiabm.git@main#egg=pyEpiabm\&subdirectory=pyEpiabm
- name: Set up R ${{ matrix.config.r }}
uses: r-lib/actions/setup-r@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: R Package Check
name: Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- '**'

jobs:
check:
Expand Down
84 changes: 74 additions & 10 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,105 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# Workflow for building and deploying package documentation
name: pkgdown

on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_LIBS_USER: ${{ github.workspace }}/R/library
RETICULATE_PYTHON: ${{ github.workspace }}/.venv/bin/python

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'

- name: Create Python virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install numpy>=1.8 pandas>=1.4 matplotlib packaging parameterized tqdm
pip install git+https://github.com/SABS-R3-Epidemiology/epiabm.git@main#egg=pyEpiabm\&subdirectory=pyEpiabm
- name: Set up reticulate configuration
run: |
mkdir -p ~/.R
echo "RETICULATE_PYTHON='${{ github.workspace }}/.venv/bin/python'" >> ~/.R/Makevars
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: https://inla.r-inla-download.org/R/stable

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libharfbuzz-dev libfribidi-dev
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::., any::XML
extra-packages: |
any::pkgdown
any::XML
any::devtools
any::reticulate
local::.
needs: website

- name: Check DESCRIPTION file format
run: |
echo "" >> DESCRIPTION # Ensure there's a newline at the end
Rscript -e 'if(length(readLines("DESCRIPTION")) == 0) stop("Empty DESCRIPTION file")'
- name: Configure reticulate
run: |
Rscript -e 'Sys.setenv(RETICULATE_PYTHON = "${{ github.workspace }}/.venv/bin/python")'
Rscript -e 'reticulate::use_virtualenv("${{ github.workspace }}/.venv")'
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

run: |
Rscript -e '
options(pkgdown.internet = FALSE)
pkgdown::build_site_github_pages(
new_process = FALSE,
install = FALSE,
examples = TRUE,
run_dont_run = FALSE
)'
- name: Deploy to GitHub pages
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
branch: gh-pages
folder: docs
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload documentation artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: pkgdown-artifacts
path: |
docs/
pkgdown/
.venv/
*.Rcheck/
*.log
68 changes: 53 additions & 15 deletions .github/workflows/test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,95 @@ on:
- '**'

jobs:

test:
name: tests on macOS with R ${{ matrix.R }}
runs-on: macos-latest
env:
R_LIBS_USER: ${{ github.workspace }}/R/library
RETICULATE_PYTHON: ${{ github.workspace }}/.venv/bin/python
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
R: [ '4.1.0' ]

steps:

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.R }}
Ncpus: 2


- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'

- name: Create Python virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install numpy>=1.8 pandas>=1.4 matplotlib packaging parameterized tqdm
pip install git+https://github.com/SABS-R3-Epidemiology/epiabm.git@main#egg=pyEpiabm\&subdirectory=pyEpiabm
- 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 installed packages
uses: actions/cache@v2

- name: Restore R package cache
uses: actions/cache@v3
id: cache
with:
path: |
${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-R${{ matrix.R }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-R${{ matrix.R }}-2-

- name: Install packages
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.R }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.R }}-

- name: Install system dependencies
run: |
brew install curl openssl libxml2
- name: Install R dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
install.packages(c("devtools"))
install.packages(c("devtools", "reticulate", "withr", "rappdirs"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check DESCRIPTION file format
run: |
echo "" >> DESCRIPTION # Ensure there's a newline at the end
Rscript -e 'if(length(readLines("DESCRIPTION")) == 0) stop("Empty DESCRIPTION file")'
- name: Set up reticulate configuration
run: |
mkdir -p ~/.R
echo "RETICULATE_PYTHON='${{ github.workspace }}/.venv/bin/python'" >> ~/.R/Makevars
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
Sys.setenv(RETICULATE_PYTHON = '${{ github.workspace }}/.venv/bin/python')
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.R }}-results
path: check
81 changes: 60 additions & 21 deletions .github/workflows/test_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,101 @@ on:
- '**'

jobs:

test:
name: tests on Ubuntu with R ${{ matrix.R }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
R_LIBS_USER: ${{ github.workspace }}/R/library
RETICULATE_PYTHON: ${{ github.workspace }}/.venv/bin/python
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
R: [ '4.1.0' ]

steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Install build dependencies
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev
uses: actions/checkout@v3

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.R }}
Ncpus: 2


- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'

- name: Create Python virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install numpy>=1.8 pandas>=1.4 matplotlib packaging parameterized tqdm
pip install git+https://github.com/SABS-R3-Epidemiology/epiabm.git@main#egg=pyEpiabm\&subdirectory=pyEpiabm
- 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 installed packages
uses: actions/cache@v2

- name: Restore R package cache
uses: actions/cache@v3
id: cache
with:
path: |
${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-R${{ matrix.R }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-R${{ matrix.R }}-2-

- name: Install packages
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.R }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.R }}-

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libharfbuzz-dev \
libfribidi-dev
- name: Install R dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
install.packages(c("devtools"))
install.packages(c("devtools", "reticulate", "withr", "rappdirs"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check DESCRIPTION file format
run: |
echo "" >> DESCRIPTION # Ensure there's a newline at the end
Rscript -e 'if(length(readLines("DESCRIPTION")) == 0) stop("Empty DESCRIPTION file")'
- name: Set up reticulate configuration
run: |
mkdir -p ~/.R
echo "RETICULATE_PYTHON='${{ github.workspace }}/.venv/bin/python'" >> ~/.R/Makevars
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
Sys.setenv(RETICULATE_PYTHON = '${{ github.workspace }}/.venv/bin/python')
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

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

0 comments on commit 5ccb207

Please sign in to comment.