From bde7925f323bfd27fc49cdc54d6ad9d838ba417e Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 23 Nov 2021 17:29:17 +0100 Subject: [PATCH 1/7] Build on windows. --- .github/workflows/ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e13f38a7..19065f3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,29 +77,38 @@ jobs: strategy: fail-fast: false matrix: - os: ['ubuntu-latest', 'macos-latest'] # TODO: Add windows here + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] steps: + - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 with: r-version: 'release' use-public-rspm: true + - uses: actions-rs/toolchain@v1 with: toolchain: 'stable' + - name: Install dependencies run: | install.packages(c("R6", "testthat", "rcmdcheck"), repos="http://cran.us.r-project.org") shell: Rscript {0} - - name: Run R CMD check + + - name: Run R CMD build run: | - R CMD check --as-cran --no-vignettes --no-manual ./changeforest-r + R CMD build ./changeforest-r + + - name: Run R CMD check + run: R CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz env: _R_CHECK_CRAN_INCOMING_: false - if: matrix.os != 'windows-latest' + + - name: Check for warnings run: | + CHECK_LOG_FILE=changeforest-r.Rcheck/00check.log CHECK_INSTALL_FILE=changeforest-r.Rcheck/00install.out if ! [[ -f "$CHECK_LOG_FILE" ]]; then @@ -122,6 +131,11 @@ jobs: # l: as login script shell: bash -lxu {0} if: matrix.os != 'windows-latest' + + - uses: actions/upload-artifact@v2 + with: + name: r-builds + path: "changeforest_*.tar.gz" python-tests: From 58d46fd5caa49e84f873b7808c5ff8a0c81476ef Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 23 Nov 2021 17:40:15 +0100 Subject: [PATCH 2/7] Simplify --- .github/workflows/ci.yml | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19065f3a..ab0259b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,41 +96,15 @@ jobs: install.packages(c("R6", "testthat", "rcmdcheck"), repos="http://cran.us.r-project.org") shell: Rscript {0} - - name: Run R CMD build + - name: Run R CMD build (non-windows) + if: matrix.os != 'windows-latest' run: | - R CMD build ./changeforest-r - - - name: Run R CMD check - run: R CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz - env: - _R_CHECK_CRAN_INCOMING_: false - + _R_CHECK_CRAN_INCOMING=false R CMD build ./changeforest-r --no-manual - - name: Check for warnings + - name: Run R CMD build (windows) + if: matrix.os == 'windows-latest' run: | - - CHECK_LOG_FILE=changeforest-r.Rcheck/00check.log - CHECK_INSTALL_FILE=changeforest-r.Rcheck/00install.out - if ! [[ -f "$CHECK_LOG_FILE" ]]; then - echo "Log-file not found." - exit 1 - fi - if cat $CHECK_LOG_FILE | grep -q "ERROR"; then - cat $CHECK_INSTALL_FILE - cat $CHECK_LOG_FILE - exit 1 - fi - if cat $CHECK_LOG_FILE | grep -q "WARNING"; then - echo "Found warnings, treated as errors." - cat $CHECK_LOG_FILE - exit 1 - fi - # e: pipefail - # x: print commands - # u: unset variables are errors - # l: as login script - shell: bash -lxu {0} - if: matrix.os != 'windows-latest' + R.exe CMD build ./changeforest-r --no-manual - uses: actions/upload-artifact@v2 with: From 814b4ffa186df291cbd1117c691c3f0c7d5c2a0d Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 23 Nov 2021 18:22:36 +0100 Subject: [PATCH 3/7] check --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab0259b3..c481c127 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,13 +99,50 @@ jobs: - name: Run R CMD build (non-windows) if: matrix.os != 'windows-latest' run: | - _R_CHECK_CRAN_INCOMING=false R CMD build ./changeforest-r --no-manual + R CMD build ./changeforest-r --no-manual + + - name: Run R CMD check (non-windows) + if: matrix.os != 'windows-latest' + run: | + _R_CHECK_CRAN_INCOMING_=false R CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz + + - name: Check log files for warnings (non-windows) + if: matrix.os != 'windows-latest' + run: | + CHECK_LOG_FILE=changeforest-r.Rcheck/00check.log + CHECK_INSTALL_FILE=changeforest-r.Rcheck/00install.out + if ! [[ -f "$CHECK_LOG_FILE" ]]; then + echo "Log-file not found." + exit 1 + fi + if cat $CHECK_LOG_FILE | grep -q "ERROR"; then + cat $CHECK_INSTALL_FILE + cat $CHECK_LOG_FILE + exit 1 + fi + if cat $CHECK_LOG_FILE | grep -q "WARNING"; then + echo "Found warnings, treated as errors." + cat $CHECK_LOG_FILE + exit 1 + fi + # e: pipefail + # x: print commands + # u: unset variables are errors + # l: as login script + shell: bash -lxu {0} - name: Run R CMD build (windows) if: matrix.os == 'windows-latest' run: | - R.exe CMD build ./changeforest-r --no-manual - + R.exe CMD build ./changeforest-r --no-manual + + - name: Run R CMD check (windows) + if: matrix.os == 'windows-latest' + run: | + R.exe CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz + + - name: Rename tarball + run: for x in changeforest_*.tar.gz; do mv $x ${x%.tar.gz}-${{ matrix.os }}.tar.gz; done - uses: actions/upload-artifact@v2 with: name: r-builds From fcdbdabb7e8d5cdc3524220e7ff70e83cd855d0f Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Wed, 24 Nov 2021 12:15:53 +0100 Subject: [PATCH 4/7] Just check. --- .github/workflows/ci.yml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c481c127..be7e4afa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,15 +96,10 @@ jobs: install.packages(c("R6", "testthat", "rcmdcheck"), repos="http://cran.us.r-project.org") shell: Rscript {0} - - name: Run R CMD build (non-windows) - if: matrix.os != 'windows-latest' - run: | - R CMD build ./changeforest-r --no-manual - - name: Run R CMD check (non-windows) if: matrix.os != 'windows-latest' run: | - _R_CHECK_CRAN_INCOMING_=false R CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz + _R_CHECK_CRAN_INCOMING_=false R CMD check --as-cran --no-vignettes --no-manual ./changeforest-r - name: Check log files for warnings (non-windows) if: matrix.os != 'windows-latest' @@ -131,22 +126,10 @@ jobs: # l: as login script shell: bash -lxu {0} - - name: Run R CMD build (windows) - if: matrix.os == 'windows-latest' - run: | - R.exe CMD build ./changeforest-r --no-manual - - name: Run R CMD check (windows) if: matrix.os == 'windows-latest' run: | - R.exe CMD check --as-cran --no-vignettes --no-manual changeforest_*.tar.gz - - - name: Rename tarball - run: for x in changeforest_*.tar.gz; do mv $x ${x%.tar.gz}-${{ matrix.os }}.tar.gz; done - - uses: actions/upload-artifact@v2 - with: - name: r-builds - path: "changeforest_*.tar.gz" + R.exe CMD check --as-cran --no-vignettes --no-manual ./changeforest-r python-tests: From d9fa7da9f5c3c2831d5fc31a6c60fe2331141f56 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Wed, 24 Nov 2021 12:24:04 +0100 Subject: [PATCH 5/7] Put title in title case. --- changeforest-r/DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changeforest-r/DESCRIPTION b/changeforest-r/DESCRIPTION index b32f662b..c354ec02 100644 --- a/changeforest-r/DESCRIPTION +++ b/changeforest-r/DESCRIPTION @@ -1,6 +1,6 @@ Package: changeforest Type: Package -Title: Classifier based non-parametric change point detection +Title: Classifier Based Non-Parametric Change Point Detection Version: 0.1.0 Author: Malte Londschien Maintainer: Malte Londschien From 0f0f71bc30dc56f578e43d2f20351f67c3994754 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Wed, 24 Nov 2021 12:28:34 +0100 Subject: [PATCH 6/7] Cat contents of r-check upon failure on windows. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5c72540..f5d4cd9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,6 +131,11 @@ jobs: run: | R.exe CMD check --as-cran --no-vignettes --no-manual ./changeforest-r + - name: Check log files for warnings (windows) + if: matrix.os == 'windows-latest' && failure() + run: | + type changeforest-r.Rcheck/00install.out + type changeforest-r.Rcheck/00check.log python-tests: name: Python tests (${{ matrix.os }}) From abc75e48801663f295f9e972745ac6678f407c98 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Wed, 24 Nov 2021 13:44:00 +0100 Subject: [PATCH 7/7] Add i686 target. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5d4cd9c..bc13c11e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,7 @@ jobs: - name: Run R CMD check (windows) if: matrix.os == 'windows-latest' run: | + rustup target add i686-pc-windows-gnu R.exe CMD check --as-cran --no-vignettes --no-manual ./changeforest-r - name: Check log files for warnings (windows)