Skip to content

Commit 3617b50

Browse files
authored
updating workflow flies (#243)
* updating workflow flies * Update R-CMD-check.yaml
1 parent ea39733 commit 3617b50

8 files changed

Lines changed: 67 additions & 32 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ on:
88
push:
99
branches: [main, master]
1010
pull_request:
11-
branches: [main, master]
1211

13-
name: R-CMD-check
12+
name: R-CMD-check.yaml
13+
14+
permissions: read-all
1415

1516
jobs:
1617
R-CMD-check:
@@ -22,24 +23,23 @@ jobs:
2223
fail-fast: false
2324
matrix:
2425
config:
25-
- {os: macOS-latest, r: 'release'}
26+
- {os: macos-latest, r: 'release'}
2627

2728
- {os: windows-latest, r: 'release'}
2829

29-
# Use older ubuntu to maximise backward compatibility
30-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
31-
- {os: ubuntu-latest, r: 'release'}
32-
- {os: ubuntu-latest, r: 'oldrel-1'}
33-
- {os: ubuntu-latest, r: 'oldrel-2'}
34-
# - {os: ubuntu-latest, r: 'oldrel-3'}
35-
# - {os: ubuntu-latest, r: 'oldrel-4'}
30+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
31+
- {os: ubuntu-latest, r: 'release'}
32+
- {os: ubuntu-latest, r: 'oldrel-1'}
33+
- {os: ubuntu-latest, r: 'oldrel-2'}
34+
- {os: ubuntu-latest, r: 'oldrel-3'}
35+
# - {os: ubuntu-latest, r: 'oldrel-4'}
3636

3737
env:
3838
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3939
R_KEEP_PKG_SOURCE: yes
4040

4141
steps:
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v4
4343

4444
- uses: r-lib/actions/setup-pandoc@v2
4545

@@ -57,3 +57,4 @@ jobs:
5757
- uses: r-lib/actions/check-r-package@v2
5858
with:
5959
upload-snapshots: true
60+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,26 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87
release:
98
types: [published]
109
workflow_dispatch:
1110

12-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
1314

1415
jobs:
1516
pkgdown:
16-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1718
# Only restrict concurrency for non-PR jobs
1819
concurrency:
1920
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2021
env:
2122
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
2225
steps:
23-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2427

2528
- uses: r-lib/actions/setup-pandoc@v2
2629

@@ -37,11 +40,9 @@ jobs:
3740
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3841
shell: Rscript {0}
3942

40-
# the pkgdown site is rendered via github.com/ddsjoberg/ggsurvfit
41-
# we keep this action to check for pkgdown errors
4243
# - name: Deploy to GitHub pages 🚀
4344
# if: github.event_name != 'pull_request'
44-
# uses: JamesIves/github-pages-deploy-action@4.1.4
45+
# uses: JamesIves/github-pages-deploy-action@v4.5.0
4546
# with:
4647
# clean: false
4748
# branch: gh-pages

.github/workflows/pr-commands.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
issue_comment:
55
types: [created]
66

7-
name: Commands
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
810

911
jobs:
1012
document:
@@ -13,8 +15,10 @@ jobs:
1315
runs-on: ubuntu-latest
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
1620
steps:
17-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
1822

1923
- uses: r-lib/actions/pr-fetch@v2
2024
with:
@@ -50,8 +54,10 @@ jobs:
5054
runs-on: ubuntu-latest
5155
env:
5256
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
5359
steps:
54-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v4
5561

5662
- uses: r-lib/actions/pr-fetch@v2
5763
with:

.github/workflows/test-coverage.yaml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87

9-
name: test-coverage
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
test-coverage:
@@ -15,17 +16,47 @@ jobs:
1516
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1617

1718
steps:
18-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
1920

2021
- uses: r-lib/actions/setup-r@v2
2122
with:
2223
use-public-rspm: true
2324

2425
- uses: r-lib/actions/setup-r-dependencies@v2
2526
with:
26-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
2728
needs: coverage
2829

2930
- name: Test coverage
30-
run: covr::codecov(quiet = FALSE)
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3139
shell: Rscript {0}
40+
41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
- name: Show testthat output
51+
if: always()
52+
run: |
53+
## --------------------------------------------------------------------
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
55+
shell: bash
56+
57+
- name: Upload test results
58+
if: failure()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: coverage-test-failures
62+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ knitr::opts_chunk$set(
1818

1919
<!-- badges: start -->
2020
[![R-CMD-check](https://github.com/pharmaverse/ggsurvfit/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pharmaverse/ggsurvfit/actions/workflows/R-CMD-check.yaml)
21-
[![Codecov test coverage](https://codecov.io/gh/pharmaverse/ggsurvfit/branch/main/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/ggsurvfit?branch=main)
21+
[![Codecov test coverage](https://codecov.io/gh/pharmaverse/ggsurvfit/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/ggsurvfit)
2222
[![CRAN status](https://www.r-pkg.org/badges/version/ggsurvfit)](https://CRAN.R-project.org/package=ggsurvfit)
2323
[![](https://cranlogs.r-pkg.org/badges/ggsurvfit)](https://cran.r-project.org/package=ggsurvfit)
2424
[<img src="http://pharmaverse.org/shields/ggsurvfit.svg">](https://pharmaverse.org)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[![R-CMD-check](https://github.com/pharmaverse/ggsurvfit/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pharmaverse/ggsurvfit/actions/workflows/R-CMD-check.yaml)
99
[![Codecov test
10-
coverage](https://codecov.io/gh/pharmaverse/ggsurvfit/branch/main/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/ggsurvfit?branch=main)
10+
coverage](https://codecov.io/gh/pharmaverse/ggsurvfit/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/ggsurvfit)
1111
[![CRAN
1212
status](https://www.r-pkg.org/badges/version/ggsurvfit)](https://CRAN.R-project.org/package=ggsurvfit)
1313
[![](https://cranlogs.r-pkg.org/badges/ggsurvfit)](https://cran.r-project.org/package=ggsurvfit)

codecov.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
comment: false
22

33
coverage:
4-
range: 0..100
5-
round: up
6-
precision: 0
7-
84
status:
95
project:
106
default:
-13.4 KB
Loading

0 commit comments

Comments
 (0)