generated from pharmaverse/admiraltemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (126 loc) · 4.08 KB
/
common.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
# Source: https://github.com/pharmaverse/admiralci
# Common workflows designed for Admiral
# but can be easily used by any other R package
name: admiral CI/CD Workflows
on:
# 'workflow_dispatch' gives you the ability
# to run this workflow on demand, anytime
workflow_dispatch:
# 'push' events are triggered when commits
# are pushed to one of these branches
push:
tags:
- "v*"
branches:
- main
- patch
# 'pull_request' events are triggered when PRs are
# created against one of these target branches.
pull_request:
branches:
- main
- patch
# 'release' events are triggered when...
# you guessed it - when releases are made.
release:
types: [published]
# Docs on concurrency:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
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
style:
name: Code Style
uses: pharmaverse/admiralci/.github/workflows/style.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
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 }}"
validation:
name: Validation
uses: pharmaverse/admiralci/.github/workflows/r-pkg-validation.yml@main
if: github.event_name == 'release'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
with:
error-on: warning # TODO: find a way to ignore specific notes
if: github.event_name == 'pull_request'
docs:
name: Documentation
uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
needs: get_r_version
with:
r-version: "release"
skip-multiversion-docs: true
secrets:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
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 }}"
links:
name: Links
uses: pharmaverse/admiralci/.github/workflows/links.yml@main
if: github.event_name == 'pull_request'
coverage:
name: Code Coverage
uses: pharmaverse/admiralci/.github/workflows/code-coverage.yml@main
if: >
github.event_name != 'release'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
# Whether to skip code coverage badge creation
# Setting to 'false' will require you to create
# an orphan branch called 'badges' in your repository
skip-coverage-badges: false
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 }}"
templates:
name: Check Templates
uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main
secrets: inherit
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
vbump:
name: Version Bump
if: github.event_name == 'push'
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.PHARMAVERSE_BOT }}