Skip to content

Commit 1d87176

Browse files
committed
ci: workflow chaining test
1 parent 9a70a43 commit 1d87176

File tree

5 files changed

+71
-44
lines changed

5 files changed

+71
-44
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ name: ci
22

33
on:
44
workflow_dispatch: #get a button to trigger it by hand
5-
push:
5+
workflow_run:
6+
workflows:
7+
- Lint
8+
type:
9+
- completed
610

711
jobs:
812
build:
913
runs-on: ubuntu-20.04
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1015
env:
1116
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1217
R_KEEP_PKG_SOURCE: yes
1318
steps:
1419
- uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.event.workflow_run.head_branch }}
1522

1623
- uses: r-lib/actions/setup-r@v2
1724
with:

.github/workflows/document.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Style
7+
type:
8+
- completed
9+
branches:
10+
- dev
11+
- ds/test
12+
13+
name: Document
14+
15+
jobs:
16+
document:
17+
runs-on: ubuntu-latest
18+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
19+
env:
20+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
21+
steps:
22+
- name: Checkout repo
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event.workflow_run.head_branch }}
27+
28+
- name: Setup R
29+
uses: r-lib/actions/setup-r@v2
30+
with:
31+
use-public-rspm: true
32+
33+
- name: Install dependencies
34+
uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::roxygen2
37+
needs: roxygen2
38+
39+
- name: Document
40+
run: roxygen2::roxygenise()
41+
shell: Rscript {0}
42+
43+
- name: Commit and push changes
44+
run: |
45+
git config --local user.name "$GITHUB_ACTOR"
46+
git config --local user.email "[email protected]"
47+
git add man/\* NAMESPACE DESCRIPTION
48+
git commit -m "Update documentation" || echo "No changes to commit"
49+
git pull --ff-only
50+
git push origin

.github/workflows/lint.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
4-
push:
5-
branches: [main, master, dev]
6-
pull_request:
7-
branches: [main, master, dev]
4+
workflow_run:
5+
workflows:
6+
- Document
7+
type:
8+
- completed
89

9-
name: lint
10+
name: Lint
1011

1112
jobs:
1213
lint:
1314
runs-on: ubuntu-latest
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618
steps:
1719
- uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.event.workflow_run.head_branch }}
1822

1923
- uses: r-lib/actions/setup-r@v2
2024
with:

.github/workflows/style_and_doc.yaml renamed to .github/workflows/style.yaml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw", "**.[rR]profile"]
5+
# paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw", "**.[rR]profile"]
66

77
name: Style
88

@@ -65,44 +65,9 @@ jobs:
6565
then
6666
git config --local user.name "$GITHUB_ACTOR"
6767
git config --local user.email "[email protected]"
68-
git commit ${FILES_TO_COMMIT[*]} -m "style: styler (GHA)"
68+
git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)"
6969
git pull --ff-only
7070
git push origin
7171
else
7272
echo "No changes to commit."
7373
fi
74-
75-
document:
76-
needs: style
77-
runs-on: ubuntu-latest
78-
env:
79-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
80-
steps:
81-
- name: Checkout repo
82-
uses: actions/checkout@v3
83-
with:
84-
fetch-depth: 0
85-
86-
- name: Setup R
87-
uses: r-lib/actions/setup-r@v2
88-
with:
89-
use-public-rspm: true
90-
91-
- name: Install dependencies
92-
uses: r-lib/actions/setup-r-dependencies@v2
93-
with:
94-
extra-packages: any::roxygen2
95-
needs: roxygen2
96-
97-
- name: Document
98-
run: roxygen2::roxygenise()
99-
shell: Rscript {0}
100-
101-
- name: Commit and push changes
102-
run: |
103-
git config --local user.name "$GITHUB_ACTOR"
104-
git config --local user.email "[email protected]"
105-
git add man/\* NAMESPACE DESCRIPTION
106-
git commit -m "docs: update documentation (GHA)" || echo "No changes to commit"
107-
git pull --ff-only
108-
git push origin

R/auth.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#' Get the API key
2+
#' @aliases get_auth_key_test
23
#'
34
#' Get the API key from the environment variable `DELPHI_EPIDATA_KEY` or
45
#' `getOption("delphi.epidata.key")`.
@@ -9,7 +10,7 @@
910
get_auth_key <- function() {
1011
key <- Sys.getenv("DELPHI_EPIDATA_KEY", unset = "")
1112
if (key != "") {
12-
return(key)
13+
return(key)
1314
}
1415

1516
key <- getOption("delphi.epidata.key", default = "")

0 commit comments

Comments
 (0)