Skip to content

Commit

Permalink
ci: fix gha
Browse files Browse the repository at this point in the history
  • Loading branch information
kapsner committed May 17, 2024
1 parent 58d1f66 commit f57d08d
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 114 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -64,36 +64,27 @@ jobs:
- uses: r-lib/actions/setup-pandoc@v2
if: matrix.config.latex == 'true'

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
if: matrix.config.java == 'true'
with:
java-version: '8'
distribution: 'temurin'
java-version: '11'

- name: Install sys deps for Ubuntu
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev

# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT

- name: "[Cache] Cache R packages"
- name: "[Cache] Restore R package cache"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@main
uses: actions/cache/restore@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

# for some strange Windows reason this step and the next one need to be decoupled
- name: "[Stage] Prepare"
run: |
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
- name: "[Stage] [Linux] Install curl"
if: runner.os == 'Linux'
run: sudo apt install libcurl4-openssl-dev

- name: "[Stage] Configure R Java"
if: runner.os != 'Windows' && matrix.config.java == 'true'
Expand All @@ -104,7 +95,6 @@ jobs:
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
remotes::install_cran(c("ParBayesianOptimization", "mlr3measures"))
shell: Rscript {0}

- name: Test coverage
Expand Down
31 changes: 11 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -64,36 +64,27 @@ jobs:
- uses: r-lib/actions/setup-pandoc@v2
if: matrix.config.latex == 'true'

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
if: matrix.config.java == 'true'
with:
java-version: '8'
distribution: 'temurin'
java-version: '11'

- name: Install sys deps for Ubuntu
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev

# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT

- name: "[Cache] Cache R packages"
- name: "[Cache] Restore R package cache"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@main
uses: actions/cache/restore@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

# for some strange Windows reason this step and the next one need to be decoupled
- name: "[Stage] Prepare"
run: |
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
- name: "[Stage] [Linux] Install curl"
if: runner.os == 'Linux'
run: sudo apt install libcurl4-openssl-dev

- name: "[Stage] Configure R Java"
if: runner.os != 'Windows' && matrix.config.java == 'true'
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/tic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -47,39 +47,58 @@ jobs:

- uses: r-lib/actions/setup-tinytex@v2
if: matrix.config.latex == 'true'
env:
# install full prebuilt version
TINYTEX_INSTALLER: TinyTeX
- run: tlmgr --version

- name: Install additional LaTeX packages
run: |
tlmgr update --self
tlmgr install babel-german
tlmgr list --only-installed
- uses: r-lib/actions/setup-pandoc@v2
if: matrix.config.latex == 'true'

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
if: matrix.config.java == 'true'
with:
java-version: 8
distribution: 'temurin'
java-version: '11'

- name: Install sys deps for Ubuntu
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev

# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT

- name: "[Cache] Cache R packages"
- name: "[Cache] Restore R package cache"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@v3
uses: actions/cache/restore@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

- name: "[Stage] Configure R Java"
if: runner.os != 'Windows' && matrix.config.java == 'true'
run: "echo export PATH=$PATH > reconf.sh; echo export JAVA_HOME=$JAVA_HOME >> reconf.sh; echo R CMD javareconf >> reconf.sh; sudo bash reconf.sh"

- name: "[Stage] Install pak"
run: Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"

- name: "[Stage] Install"
run: Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']]) && !grepl('Under development', R.version[['status']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}else{options(repos = c(CRAN = 'cloud.r-project.org'))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
run: Rscript -e "install.packages('tic', repos = c('https://ropensci.r-universe.dev', if (grepl('Ubuntu', Sys.info()[['version']])) {sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))} else {'https://cloud.r-project.org'}))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"

- name: "[Cache] Save R package cache"
if: runner.os != 'Windows' && always()
uses: actions/cache/save@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

- name: "[Stage] Script"
run: Rscript -e 'tic::script()'
Expand All @@ -89,7 +108,7 @@ jobs:

- name: "[Stage] Upload R CMD check artifacts"
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/update-tic.yml

This file was deleted.

4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mllrnrs
Title: R6-Based ML Learners for 'mlexperiments'
Version: 0.0.3.9007
Version: 0.0.3.9008
Authors@R:
person("Lorenz A.", "Kapsner", , "[email protected]", role = c("cre", "aut", "cph"),
comment = c(ORCID = "0000-0003-1866-860X"))
Expand Down Expand Up @@ -40,7 +40,7 @@ VignetteBuilder:
knitr
Config/testthat/edition: 3
Config/testthat/parallel: false
Date/Publication: 2024-04-15 16:09:40.514639 UTC
Date/Publication: 2024-05-17 12:29:20.149287 UTC
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
11 changes: 6 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# mllrnrs NEWS

## Unreleased (2024-04-12)
## Unreleased (2024-04-15)

#### New features

Expand All @@ -26,7 +27,7 @@
([323f9cb](https://github.com/kapsner/mllrnrs/tree/323f9cb0dc0e38213154669dccff7a700f5071c2))

Full set of changes:
[`v0.0.3...1674811`](https://github.com/kapsner/mllrnrs/compare/v0.0.3...1674811)
[`v0.0.3...58d1f66`](https://github.com/kapsner/mllrnrs/compare/v0.0.3...58d1f66)

## v0.0.3 (2024-03-07)

Expand All @@ -51,7 +52,7 @@ Full set of changes:
([09cde9d](https://github.com/kapsner/mllrnrs/tree/09cde9d8eb6e38310d405ce4f669eb6fb64a1b37))
- temporary fix for compatibility with lightgbm
([7a9ef30](https://github.com/kapsner/mllrnrs/tree/7a9ef307926c07ca6f2b33c2d93f4431d2a0a8c8))
- adaptions to cat\_vars
- adaptions to cat_vars
([e9f0eff](https://github.com/kapsner/mllrnrs/tree/e9f0effbc2b1274f8f32a86c12b4a68ece9163de))

#### Tests
Expand All @@ -61,7 +62,7 @@ Full set of changes:

#### CI

- moving to code\_step
- moving to code_step
([2e4d11a](https://github.com/kapsner/mllrnrs/tree/2e4d11a96f5f91f62e05772f77237ac384f7e130))
- update coverage installing packages
([a2aec56](https://github.com/kapsner/mllrnrs/tree/a2aec569a52d66c2ba9feb2c6ae825c1afb3be92))
Expand Down Expand Up @@ -157,7 +158,7 @@ Full set of changes:

- changed order of list to be updated
([066eb5a](https://github.com/kapsner/mllrnrs/tree/066eb5a05408e92025c570b58def13c29ed25bab))
- to metric\_types\_helper from mlexperiments
- to metric_types_helper from mlexperiments
([1099f1a](https://github.com/kapsner/mllrnrs/tree/1099f1aac600c2cac41a789ca5bdfcc91f2f802b))
- code adaptions to upstream changes
([c5363fc](https://github.com/kapsner/mllrnrs/tree/c5363fc2be191343ef5ebfd3363a535e0ea5e458))
Expand Down
2 changes: 1 addition & 1 deletion data-raw/devstuffs.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ my_desc$set_authors(c(
# Remove some author fields
my_desc$del("Maintainer")
# Set the version
my_desc$set_version("0.0.3.9007")
my_desc$set_version("0.0.3.9008")
# The title of your package
my_desc$set(Title = "R6-Based ML Learners for 'mlexperiments'")
# The description of your package
Expand Down
2 changes: 1 addition & 1 deletion vignettes/mllrnrs_ranger_multiclass.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ perf_ranger

## Appendix I: Grid-Search with Target Weigths

Here, `ranger`'s [`case.weights`-argument](hthttps://rdrr.io/cran/ranger/man/ranger.html) is used to rescale the case-weights during the training.
Here, `ranger`'s [`case.weights`-argument](https://rdrr.io/cran/ranger/man/ranger.html) is used to rescale the case-weights during the training.

```{r}
# define the target weights
Expand Down

0 comments on commit f57d08d

Please sign in to comment.