Skip to content

Commit

Permalink
Use github actions for CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludvig committed Nov 19, 2022
1 parent ae01728 commit 470e643
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 29 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/R-check-depends-only.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

# Runs without suggested packages as these must be handled conditionally
# 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

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

#name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_DEPENDS_ONLY_: true

steps:
- uses: actions/checkout@v2

# Always try to use the latest pandoc version
# https://github.com/jgm/pandoc/releases
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.19.2'

- 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

# TODO: Check which of the ignore conditions are still relevant given the
# current suggested dependencies and the minimum supported R version.
# Update if anything out of date or not needed anymore.
#
# `{EGAnet}` needs `{XML}`, and there are currently issues in downloading
# it for certain R versions. So just don't install it for now.
- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: |
any::rcmdcheck
needs: check

# Don't error on "note" because if any of the suggested packages are not available
# for a given R version, this generates a NOTE causing unnecessary build failure
- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"warning"'
upload-snapshots: true
73 changes: 73 additions & 0 deletions .github/workflows/R-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

#name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'oldrel'}

- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false

steps:
- uses: actions/checkout@v2

# Always try to use the latest pandoc version
# https://github.com/jgm/pandoc/releases
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.19.2'

- 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

# TODO: Check which of the ignore conditions are still relevant given the
# current suggested dependencies and the minimum supported R version.
# Update if anything out of date or not needed anymore.
#
# `{EGAnet}` needs `{XML}`, and there are currently issues in downloading
# it for certain R versions. So just don't install it for now.
- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: |
any::rcmdcheck
needs: check

# Don't error on "note" because if any of the suggested packages are not available
# for a given R version, this generates a NOTE causing unnecessary build failure
- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"warning"'
upload-snapshots: true
30 changes: 30 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: covr

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: lint

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: lintr

- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

0 comments on commit 470e643

Please sign in to comment.