-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.19 KB
/
rhino-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Rhino Test
on: push
permissions:
contents: read
jobs:
main:
name: Run linters and tests
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Extract R version from lockfile
run: printf 'R_VERSION=%s\n' "$(jq --raw-output .R.Version renv.lock)" >> $GITHUB_ENV
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ env.R_VERSION }}
- name: Setup system dependencies
run: >
sudo apt-get update && sudo apt-get install --yes
libcurl4-openssl-dev
- 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: Build JavaScript
if: always()
shell: Rscript {0}
run: rhino::build_js()
- name: Build Sass
if: always()
shell: Rscript {0}
run: rhino::build_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@v5
with:
working-directory: .rhino # Created by earlier commands which use Node.js
start: npm run run-app
project: ../tests
wait-on: 'http://localhost:3333/'
wait-on-timeout: 60