Skip to content

Commit

Permalink
ci: fixing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kapsner committed May 16, 2024
1 parent 6a6793a commit 8210403
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 99 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
^dqagui\.Rproj$
^man/figures$
^Rplots\.pdf$
^\.Rproj\.user$
31 changes: 11 additions & 20 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.saobby.my.eu.orgmunity/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
34 changes: 12 additions & 22 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,41 +64,31 @@ 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.saobby.my.eu.orgmunity/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'
run: sudo R CMD javareconf

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: Install dependencies
run: |
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.saobby.my.eu.orgmunity/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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
!/docker/app.R
!/docker/shiny-server.conf
!/docker/show-log.sh
.Rproj.user
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: DQAgui
Title: Graphical User Interface for Data Quality Assessment
Version: 0.2.3.9001
Version: 0.2.3.9002
Authors@R: c(
person("Lorenz A.", "Kapsner", , "lorenz.kapsner@gmail.com", role = c("cre", "aut"),
comment = c(ORCID = "0000-0003-1866-860X")),
Expand All @@ -14,7 +14,7 @@ License: GPL-3
URL: https://github.com/miracum/dqa-dqagui
BugReports: https://github.com/miracum/dqa-dqagui/issues
Encoding: UTF-8
Date: 2023-08-30
Date: 2024-05-16
Imports:
data.table,
daterangepicker,
Expand All @@ -37,3 +37,4 @@ Imports:
Suggests:
lintr,
testthat (>= 3.0.0)
RoxygenNote: 7.3.1
Loading

0 comments on commit 8210403

Please sign in to comment.