Skip to content

Commit 327b556

Browse files
authored
Merge pull request #101 from mlr-org/update_workflows
Update workflows
2 parents 3655cce + e6d7a6f commit 327b556

File tree

207 files changed

+2449
-1418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+2449
-1418
lines changed

.github/workflows/rcmdcheck.yml

+45-24
Original file line numberDiff line numberDiff line change
@@ -16,66 +16,87 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
config:
19-
- { os: ubuntu-latest, r: "release" }
19+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2020

2121
env:
2222
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
2323
RSPM: ${{ matrix.config.rspm }}
24+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2425

2526
steps:
2627
- uses: actions/checkout@v2
2728

28-
- uses: r-lib/actions/setup-r@master
29+
- uses: r-lib/actions/setup-r@v1
30+
id: install-r
2931
with:
3032
r-version: ${{ matrix.config.r }}
33+
http-user-agent: ${{ matrix.config.http-user-agent }}
3134

32-
- uses: r-lib/actions/setup-pandoc@master
35+
- uses: r-lib/actions/setup-pandoc@v1
3336

34-
- name: Query dependencies
37+
- name: Install pak and query dependencies
3538
run: |
36-
install.packages('remotes')
37-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
38-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
39+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
40+
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
3941
shell: Rscript {0}
4042

41-
- name: Cache R packages
42-
uses: actions/cache@v1
43+
- name: Restore R package cache
44+
uses: actions/cache@v2
4345
with:
44-
path: ${{ env.R_LIBS_USER }}
45-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
46-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
46+
path: |
47+
${{ env.R_LIBS_USER }}/*
48+
!${{ env.R_LIBS_USER }}/pak
49+
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
50+
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
4751

4852
- name: Install system dependencies
53+
if: runner.os == 'Linux'
4954
run: |
50-
set -x
51-
while read -r cmd
52-
do
53-
eval sudo $cmd
54-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
55+
pak::local_system_requirements(execute = TRUE)
56+
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
57+
shell: Rscript {0}
5558

5659
- name: Install dependencies
5760
run: |
58-
install.packages(c("remotes"))
59-
remotes::install_deps(dependencies = TRUE)
60-
remotes::install_cran("rcmdcheck")
61+
pak::local_install_dev_deps(upgrade = TRUE)
62+
pak::pkg_install("rcmdcheck")
63+
shell: Rscript {0}
64+
65+
- name: Install CatBoost
66+
run: |
67+
install.packages("remotes")
68+
remotes::install_url('https://github.com/catboost/catboost/releases/download/v0.24.1/catboost-R-Linux-0.24.1.tgz', INSTALL_opts = c("--no-multiarch"))
6169
shell: Rscript {0}
6270

6371
- name: Install Python
6472
run: |
65-
remotes::install_github('rstudio/reticulate')
73+
pak::pkg_install('rstudio/reticulate')
6674
reticulate::install_miniconda()
67-
remotes::install_local()
6875
install.packages('keras')
6976
keras::install_keras(tensorflow = '2.0.1', extra_packages = c('IPython', 'requests', 'certifi', 'urllib3', 'tensorflow-hub', 'tabnet==0.1.4.1'))
7077
reticulate::py_install(c('torch', 'pycox'), pip = TRUE)
7178
shell: Rscript {0}
7279

80+
- name: Session info
81+
run: |
82+
options(width = 100)
83+
pkgs <- installed.packages()[, "Package"]
84+
sessioninfo::session_info(pkgs, include_base = TRUE)
85+
shell: Rscript {0}
86+
7387
- name: Check
7488
env:
75-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
76-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
89+
_R_CHECK_CRAN_INCOMING_: false
90+
run: |
91+
options(crayon.enabled = TRUE)
92+
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
7793
shell: Rscript {0}
7894

95+
- name: Show testthat output
96+
if: always()
97+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
98+
shell: bash
99+
79100
- name: Upload check results
80101
if: failure()
81102
uses: actions/upload-artifact@main

.github/workflows/test_C50.yml

+58-32
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,96 @@
11
on:
2-
push:
3-
branches: main
4-
paths: '**/C50**'
52
pull_request:
63
branches: main
74
paths: '**/C50**'
8-
schedule:
9-
- cron: "0 4 * * *"
105

116
name: C50 (ubuntu-latest, release)
127

138
jobs:
14-
all:
9+
R-CMD-check:
1510
runs-on: ${{ matrix.config.os }}
1611

17-
name: ${{ matrix.env.TEST }} Test
12+
name: ${{ matrix.env.test }} Test
1813

1914
strategy:
15+
fail-fast: false
2016
matrix:
2117
env:
2218
- { test: "Learner"}
2319
- { test: "Param"}
2420
config:
25-
- { os: ubuntu-latest, r: "release" }
21+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2622

2723
env:
2824
PKG: C50
2925
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30-
RGL_USE_NULL: true
31-
TEST: ${{ matrix.env.test }}
32-
26+
RSPM: ${{ matrix.config.rspm }}
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
28+
3329
steps:
34-
- uses: actions/checkout@v2.2.0
30+
- uses: actions/checkout@v2
3531

36-
- uses: r-lib/actions/setup-r@master
32+
- uses: r-lib/actions/setup-r@v1
33+
id: install-r
3734
with:
3835
r-version: ${{ matrix.config.r }}
39-
Ncpus: 4
36+
http-user-agent: ${{ matrix.config.http-user-agent }}
4037

41-
- uses: r-lib/actions/setup-tinytex@master
38+
- uses: r-lib/actions/setup-pandoc@v1
4239

43-
- uses: r-lib/actions/setup-pandoc@master
40+
- name: Install pak and query dependencies
41+
run: |
42+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
43+
saveRDS(pak::pkg_deps("local::.", dependencies = FALSE), ".github/r-depends.rds")
44+
shell: Rscript {0}
45+
46+
- name: Restore R package cache
47+
uses: actions/cache@v2
48+
with:
49+
path: |
50+
${{ env.R_LIBS_USER }}/*
51+
!${{ env.R_LIBS_USER }}/pak
52+
key: ${{ matrix.config.os }}-${{ env.PKG }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
53+
restore-keys: ${{ matrix.config.os }}-${{ env.PKG }}-${{ steps.install-r.outputs.installed-r-version }}-1-
4454

45-
- name: "[Stage] Prepare"
46-
if: runner.os == 'Linux'
55+
- name: Install system dependencies
4756
run: |
48-
sudo R CMD javareconf
49-
sudo apt install ccache libcurl4-openssl-dev libgit2-dev
50-
mkdir -p ~/.R && echo -e 'CXX_STD = CXX14\n\nCC=ccache gcc -std=gnu99\nCXX=ccache g++\nCXX11=ccache g++ -std=gnu99\nCXX14=ccache g++ -std=gnu99\nC11=ccache g++\nC14=ccache g++\nFC=ccache gfortran\nF77=ccache gfortran' > $HOME/.R/Makevars
57+
pak::local_system_requirements(execute = TRUE)
58+
pak::pkg_system_requirements("testthat", execute = TRUE)
59+
shell: Rscript {0}
5160

52-
- name: "[Custom block] [Stage] [Linux] Install pkgdown system lib req"
53-
if: runner.os == 'Linux'
54-
run: sudo apt install libharfbuzz-dev libfribidi-dev
61+
- name: Install package dependencies
62+
run: |
63+
pak::local_install_dev_deps(upgrade = TRUE, dependencies = FALSE)
64+
pak::pkg_install("testthat")
65+
shell: Rscript {0}
66+
67+
- name: Session info
68+
run: |
69+
sessionInfo()
70+
shell: Rscript {0}
71+
72+
- name: Install
73+
run: |
74+
pak::local_install()
75+
shell: Rscript {0}
5576

56-
- name: "[Stage] Install"
77+
- name: Learner test
78+
if: ${{ matrix.env.test == 'Learner' }}
5779
run: |
58-
Rscript -e "install.packages('remotes', type = 'source')" -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
80+
options(crayon.enabled = TRUE)
81+
testthat::test_local(filter = sprintf("%s_", "${{ env.PKG }}"))
82+
shell: Rscript {0}
5983

60-
- name: "[Stage] Script"
84+
- name: Parameter test
85+
if: ${{ matrix.env.test == 'Param' }}
6186
run: |
62-
R CMD INSTALL .
63-
Rscript -e "tic::script()"
87+
options(crayon.enabled = TRUE)
88+
testthat::test_dir(system.file("paramtest", package = "mlr3extralearners"), filter = sprintf("_%s_", "${{ env.PKG }}"))
89+
shell: Rscript {0}
6490

65-
- name: "[Stage] Upload R CMD check artifacts"
91+
- name: Upload check results
6692
if: failure()
67-
uses: actions/upload-artifact@master
93+
uses: actions/upload-artifact@main
6894
with:
69-
name: ${{ runner.os }}-r${{ matrix.config.r }}-r${{ matrix.env.PKG }}-results
95+
name: ${{ runner.os }}-r${{ matrix.config.r }}-${{ env.PKG }}-results
7096
path: check

.github/workflows/test_CoxBoost.yml

+60-32
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,98 @@
11
on:
2-
push:
3-
branches: main
4-
paths: '**/CoxBoost**'
52
pull_request:
63
branches: main
74
paths: '**/CoxBoost**'
8-
schedule:
9-
- cron: "0 4 * * *"
105

116
name: CoxBoost (ubuntu-latest, release)
127

138
jobs:
14-
all:
9+
R-CMD-check:
1510
runs-on: ${{ matrix.config.os }}
1611

17-
name: ${{ matrix.env.TEST }} Test
12+
name: ${{ matrix.env.test }} Test
1813

1914
strategy:
15+
fail-fast: false
2016
matrix:
2117
env:
2218
- { test: "Learner"}
2319
- { test: "Param"}
2420
config:
25-
- { os: ubuntu-latest, r: "release" }
21+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2622

2723
env:
2824
PKG: CoxBoost
2925
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30-
RGL_USE_NULL: true
31-
TEST: ${{ matrix.env.test }}
32-
26+
RSPM: ${{ matrix.config.rspm }}
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
28+
3329
steps:
34-
- uses: actions/checkout@v2.2.0
30+
- uses: actions/checkout@v2
3531

36-
- uses: r-lib/actions/setup-r@master
32+
- uses: r-lib/actions/setup-r@v1
33+
id: install-r
3734
with:
3835
r-version: ${{ matrix.config.r }}
39-
Ncpus: 4
36+
http-user-agent: ${{ matrix.config.http-user-agent }}
4037

41-
- uses: r-lib/actions/setup-tinytex@master
38+
- uses: r-lib/actions/setup-pandoc@v1
4239

43-
- uses: r-lib/actions/setup-pandoc@master
40+
- name: Install pak and query dependencies
41+
run: |
42+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
43+
saveRDS(pak::pkg_deps("local::.", dependencies = FALSE), ".github/r-depends.rds")
44+
shell: Rscript {0}
45+
46+
- name: Restore R package cache
47+
uses: actions/cache@v2
48+
with:
49+
path: |
50+
${{ env.R_LIBS_USER }}/*
51+
!${{ env.R_LIBS_USER }}/pak
52+
key: ${{ matrix.config.os }}-${{ env.PKG }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
53+
restore-keys: ${{ matrix.config.os }}-${{ env.PKG }}-${{ steps.install-r.outputs.installed-r-version }}-1-
4454

45-
- name: "[Stage] Prepare"
46-
if: runner.os == 'Linux'
55+
- name: Install system dependencies
4756
run: |
48-
sudo R CMD javareconf
49-
sudo apt install ccache libcurl4-openssl-dev libgit2-dev
50-
mkdir -p ~/.R && echo -e 'CXX_STD = CXX14\n\nCC=ccache gcc -std=gnu99\nCXX=ccache g++\nCXX11=ccache g++ -std=gnu99\nCXX14=ccache g++ -std=gnu99\nC11=ccache g++\nC14=ccache g++\nFC=ccache gfortran\nF77=ccache gfortran' > $HOME/.R/Makevars
57+
pak::local_system_requirements(execute = TRUE)
58+
pak::pkg_system_requirements("testthat", execute = TRUE)
59+
pak::pkg_system_requirements("remotes", execute = TRUE)
60+
shell: Rscript {0}
5161

52-
- name: "[Custom block] [Stage] [Linux] Install pkgdown system lib req"
53-
if: runner.os == 'Linux'
54-
run: sudo apt install libharfbuzz-dev libfribidi-dev
62+
- name: Install package dependencies
63+
run: |
64+
pak::local_install_dev_deps(upgrade = TRUE, dependencies = FALSE)
65+
pak::pkg_install("testthat")
66+
pak::pkg_install("remotes")
67+
shell: Rscript {0}
68+
69+
- name: Session info
70+
run: |
71+
sessionInfo()
72+
shell: Rscript {0}
73+
74+
- name: Install
75+
run: |
76+
pak::local_install()
77+
shell: Rscript {0}
5578

56-
- name: "[Stage] Install"
79+
- name: Learner test
80+
if: ${{ matrix.env.test == 'Learner' }}
5781
run: |
58-
Rscript -e "install.packages('remotes', type = 'source')" -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
82+
options(crayon.enabled = TRUE)
83+
testthat::test_local(filter = sprintf("%s_", "${{ env.PKG }}"))
84+
shell: Rscript {0}
5985

60-
- name: "[Stage] Script"
86+
- name: Parameter test
87+
if: ${{ matrix.env.test == 'Param' }}
6188
run: |
62-
R CMD INSTALL .
63-
Rscript -e "tic::script()"
89+
options(crayon.enabled = TRUE)
90+
testthat::test_dir(system.file("paramtest", package = "mlr3extralearners"), filter = sprintf("_%s_", "${{ env.PKG }}"))
91+
shell: Rscript {0}
6492

65-
- name: "[Stage] Upload R CMD check artifacts"
93+
- name: Upload check results
6694
if: failure()
67-
uses: actions/upload-artifact@master
95+
uses: actions/upload-artifact@main
6896
with:
69-
name: ${{ runner.os }}-r${{ matrix.config.r }}-r${{ matrix.env.PKG }}-results
97+
name: ${{ runner.os }}-r${{ matrix.config.r }}-${{ env.PKG }}-results
7098
path: check

0 commit comments

Comments
 (0)