From 26c48ad8a6bde7a5ab98cbf183006eb2ebf8d5a3 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 14 Dec 2021 16:50:12 +0900 Subject: [PATCH] Add -lbcrypt (#156) --- .github/workflows/R-CMD-check.yaml | 84 ++++++---------------- inst/templates/Makevars.win | 2 +- tests/data/test-knitr-engine-source-01.Rmd | 2 +- tests/testthat/_snaps/use_extendr.md | 2 +- 4 files changed, 23 insertions(+), 67 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9c9b5904..b67c2d76 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,12 +1,8 @@ on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] name: R-CMD-check @@ -14,86 +10,46 @@ jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }} / ${{ matrix.config.rust-version }}) + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) strategy: fail-fast: false matrix: config: - {os: windows-latest, r: 'release', rust-version: 'stable-msvc'} - - {os: macOS-latest, r: 'release', rust-version: 'stable'} - - {os: ubuntu-20.04, r: 'release', rust-version: 'stable', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rust-version: 'stable', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: macOS-latest, r: 'release', rust-version: 'stable' } + - {os: ubuntu-20.04, r: 'release', rust-version: 'stable' } + - {os: ubuntu-20.04, r: 'devel', rust-version: 'stable' } env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v2 - + + - uses: r-lib/actions/setup-pandoc@v1 + - name: Set up Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.config.rust-version }} default: true - - name: Set up R - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.config.r }} - windows-path-include-mingw: false - - - name: Set up pandoc - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages (not Windows) - if: startsWith(runner.os, 'Windows') == false - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - name: Configure Windows if: startsWith(runner.os, 'Windows') run: | rustup target add x86_64-pc-windows-gnu rustup target add i686-pc-windows-gnu - shell: pwsh - - - name: Configure Linux - if: startsWith(runner.os, 'Linux') - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - id: rcmd_check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--force-multiarch"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/setup-r-dependencies@v1 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-rust${{ matrix.config.rust-version }}-results - path: check + extra-packages: rcmdcheck + + - uses: r-lib/actions/check-r-package@v1 diff --git a/inst/templates/Makevars.win b/inst/templates/Makevars.win index 56e189c2..bb570f87 100644 --- a/inst/templates/Makevars.win +++ b/inst/templates/Makevars.win @@ -3,7 +3,7 @@ TOOLCHAIN = stable-msvc TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/lib{{{pkg_name}}}.a -PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv +PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt all: C_clean diff --git a/tests/data/test-knitr-engine-source-01.Rmd b/tests/data/test-knitr-engine-source-01.Rmd index a25b53dd..07476704 100644 --- a/tests/data/test-knitr-engine-source-01.Rmd +++ b/tests/data/test-knitr-engine-source-01.Rmd @@ -81,4 +81,4 @@ The quick brown fox **jumps over** the lazy dog. The quick *brown fox* jumps over the lazy dog." md_to_html(md_text) -``` \ No newline at end of file +``` diff --git a/tests/testthat/_snaps/use_extendr.md b/tests/testthat/_snaps/use_extendr.md index 2a273b7d..9d0fd41c 100644 --- a/tests/testthat/_snaps/use_extendr.md +++ b/tests/testthat/_snaps/use_extendr.md @@ -62,7 +62,7 @@ TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/libtestpkg.a - PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv + PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt all: C_clean