Skip to content

Commit

Permalink
Merge pull request #66 from Appsilon/expand-ci
Browse files Browse the repository at this point in the history
Expand CI
  • Loading branch information
jakubnowicki authored Feb 21, 2022
2 parents 1177977 + 4c54168 commit 6c9edf2
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 34 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
Imports:
cli,
glue,
fs,
lintr (>= 2.0.0),
renv,
Expand Down
5 changes: 4 additions & 1 deletion R/node.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
system_yarn <- function(...) {
system2(
status <- system2(
command = "yarn",
args = c("--cwd", shQuote(node_path()), ...)
)
if (status != 0) {
stop(glue::glue("yarn failed with exit status {status}"), call. = FALSE)
}
}

add_node <- function() {
Expand Down
33 changes: 0 additions & 33 deletions inst/templates/github_ci/dot.github/workflows/linter.yml

This file was deleted.

67 changes: 67 additions & 0 deletions inst/templates/github_ci/dot.github/workflows/rhino-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Rhino Test
on: push
permissions:
contents: read
jobs:
main:
name: Run linters and tests
runs-on: ubuntu-20.04
env:
R_VERSION: '4.1.0'
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup R
uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ env.R_VERSION }}

- name: Restore renv from cache
uses: actions/cache@v2
env:
CACHE_KEY: renv-${{ runner.arch }}-${{ runner.os }}-${{ env.R_VERSION }}
with:
path: renv/library
key: ${{ env.CACHE_KEY }}-${{ hashFiles('renv.lock') }}
restore-keys: ${{ env.CACHE_KEY }}-

- name: Sync renv with lockfile
shell: Rscript {0}
run: |
options(renv.config.cache.symlinks = FALSE)
renv::restore(clean = TRUE)
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16

- name: Lint R
if: always()
shell: Rscript {0}
run: rhino::lint_r()

- name: Lint JavaScript
if: always()
shell: Rscript {0}
run: rhino::lint_js()

- name: Lint Sass
if: always()
shell: Rscript {0}
run: rhino::lint_sass()

- name: Run R unit tests
if: always()
shell: Rscript {0}
run: rhino::test_r()

- name: Run Cypress end-to-end tests
if: always()
uses: cypress-io/github-action@v2
with:
working-directory: .rhino/node # Created by earlier commands which use Node.js
start: yarn run-app
project: root/tests

0 comments on commit 6c9edf2

Please sign in to comment.