Skip to content

Commit dc266aa

Browse files
Merge pull request #1158 from zkamvar/znk/update-workflows
update workflows
2 parents da73cfe + 16fe24b commit dc266aa

File tree

3 files changed

+94
-2
lines changed

3 files changed

+94
-2
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build dependency cache on main branch
2+
on:
3+
push:
4+
branches: [main, master]
5+
paths:
6+
- '.github/workflows/cache-hubval-deps.yaml'
7+
schedule:
8+
- cron: "10 0 * * *"
9+
10+
jobs:
11+
build-deps-cache-on-main:
12+
if: ${{ github.repository_owner == github.repository_owner }}
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: r-lib/actions/setup-r@v2
21+
with:
22+
install-r: false
23+
use-public-rspm: true
24+
extra-repositories: 'https://hubverse-org.r-universe.dev'
25+
26+
- name: Update R
27+
run: |
28+
sudo apt-get update
29+
30+
- uses: r-lib/actions/setup-r-dependencies@v2
31+
with:
32+
packages: |
33+
any::hubValidations
34+
any::sessioninfo
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Hub Config Validation (R)
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: main
7+
paths:
8+
- 'hub-config/**'
9+
- '!**README**'
10+
11+
jobs:
12+
validate-hub-config:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
PR_NUMBER: ${{ github.event.number }}
17+
HUB_PATH: ${{ github.workspace }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
install-r: false
25+
use-public-rspm: true
26+
extra-repositories: 'https://hubverse-org.r-universe.dev'
27+
28+
- name: Update R
29+
run: |
30+
sudo apt-get update
31+
32+
- uses: r-lib/actions/setup-r-dependencies@v2
33+
with:
34+
cache: 'always'
35+
packages: |
36+
any::hubAdmin
37+
any::sessioninfo
38+
39+
- name: Run validations
40+
id: validate
41+
run: hubAdmin::ci_validate_hub_config(diff = "${{ runner.temp }}/diff.md")
42+
shell: Rscript {0}
43+
- name: "Comment on PR"
44+
id: comment-diff
45+
if: ${{ github.event_name != 'workflow_dispatch' }}
46+
uses: carpentries/actions/comment-diff@main
47+
with:
48+
pr: ${{ env.PR_NUMBER }}
49+
path: ${{ runner.temp }}/diff.md
50+
- name: Error on Failure
51+
if: ${{ steps.validate.outputs.result == 'false' }}
52+
run: |
53+
echo "::error title=Invalid Configuration::Errors were detected in one or more config files in 'hub-config/'"
54+
exit 1
55+

.github/workflows/validate-submission.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ jobs:
1616
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- uses: r-lib/actions/setup-r@v2
2222
with:
2323
install-r: false
2424
use-public-rspm: true
25+
extra-repositories: 'https://hubverse-org.r-universe.dev'
2526

2627
- name: Update R
2728
run: |
2829
sudo apt-get update
2930
3031
- uses: r-lib/actions/setup-r-dependencies@v2
3132
with:
32-
packages: Infectious-Disease-Modeling-Hubs/hubValidations, any::sessioninfo
33+
packages: |
34+
any::hubValidations
35+
any::sessioninfo
3336
3437
- name: Run validations
3538
env:

0 commit comments

Comments
 (0)