-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (75 loc) · 2.36 KB
/
admiral.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
# Source: https://github.com/pharmaverse/admiralci
# Stripped down version of admiralci checks. Good for
# the developement process. When package is ready to
# be published, revisit and add release-related
# workflows.
name: admiral CI/CD Workflows
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: admiral-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
R_VERSION: "release"
jobs:
get_r_version:
name: Get R version
runs-on: ubuntu-latest
outputs:
r-version: ${{ steps.get_r_version.outputs.R_VERSION }}
steps:
- name: Get R Version for Downstream Container Jobs
id: get_r_version
run: echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
shell: bash
spellcheck:
name: Spelling
uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
linter:
name: Lint
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
needs: get_r_version
if: github.event_name == 'pull_request'
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
man-pages:
name: Man Pages
uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
test:
runs-on: ubuntu-latest
needs: get_r_version
container:
image: "ghcr.io/pharmaverse/admiralci-${{ needs.get_r_version.outputs.r-version }}:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install dependencies
run: |
Rscript -e 'install.packages("remotes")'
Rscript -e 'remotes::install_deps(dependencies = TRUE)'
- name: Run tests
run: |
Rscript -e 'if (!requireNamespace("testthat", quietly = TRUE)) install.packages("testthat")'
Rscript -e 'testthat::test_dir("tests/testthat")'
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
if: github.event_name == 'pull_request'
with:
error-on: error