Skip to content

Commit

Permalink
Merge branch 'ci/Enable-codecov-status-checks' of https://github.com/…
Browse files Browse the repository at this point in the history
…Ilia-Kosenkov/rextendr into ci/Enable-codecov-status-checks
  • Loading branch information
Ilia-Kosenkov committed Nov 14, 2024
2 parents ec09748 + 2d70e0e commit 19ad41b
Show file tree
Hide file tree
Showing 74 changed files with 3,095 additions and 279 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
^\.idea$
^inst/libgcc_mock/libgcc_eh.a$
^CRAN-SUBMISSION$
^vignettes/articles$
29 changes: 11 additions & 18 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
types:
- opened
- reopened
- synchronize
- ready_for_review

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }} - ${{ matrix.config.rust-version }})
name: R-CMD-Check ${{ matrix.config.os }} (${{ matrix.config.r }} - ${{ matrix.config.rust-version }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu' }
- {os: windows-latest, r: 'devel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu' }
- {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu', rtools-version: '42' }
- {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu', rtools-version: '43' }

- {os: macOS-latest, r: 'release', rust-version: 'stable' }

Expand All @@ -29,18 +34,17 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
REXTENDR_SKIP_DEV_TESTS: TRUE # TODO: Remove this when extendr/libR-sys issue is resolved

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.config.rust-version }}
targets: ${{ matrix.config.rust-target }}

- uses: baptiste0928/cargo-install@v2
- uses: baptiste0928/cargo-install@v3
if: matrix.config.r == 'release'
with:
crate: cargo-license
Expand All @@ -49,24 +53,13 @@ jobs:
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools-version }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: rcmdcheck

# TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html)
- name: Check R version
id: error-on
run: |
output <- Sys.getenv("GITHUB_OUTPUT")
if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") {
cat('level=error', file = output, append = TRUE)
} else {
cat('level=warning', file = output, append = TRUE)
}
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"${{ steps.error-on.outputs.level }}"'
error-on: '"note"'
5 changes: 5 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
types:
- opened
- reopened
- synchronize
- ready_for_review

name: lint

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
types:
- opened
- reopened
- synchronize
- ready_for_review
release:
types: [published]
workflow_dispatch:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
types:
- opened
- reopened
- synchronize
- ready_for_review

name: test-coverage

Expand All @@ -13,6 +18,7 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
REXTENDR_SKIP_DEV_TESTS: TRUE # TODO: Remove this when extendr/libR-sys issue is resolved

steps:
- uses: actions/checkout@v3
Expand Down
34 changes: 10 additions & 24 deletions .github/workflows/test_pkg_gen.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]
types:
- opened
- reopened
- synchronize
- ready_for_review

name: Test package generation

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }} / ${{ matrix.config.rust-version }})
name: PkgGen ${{ matrix.config.os }} (${{ matrix.config.r }} - ${{ matrix.config.rust-version }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu'}
- {os: windows-latest, r: 'devel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu'}
- {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu', rtools-version: '42'}
- {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', rust-target: 'x86_64-pc-windows-gnu', rtools-version: '43'}

- {os: macOS-latest, r: 'release', rust-version: 'stable'}

Expand All @@ -47,11 +48,7 @@ jobs:
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools-version }}
# TODO: enable RSPM when all the packages are available
use-public-rspm: false

- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down Expand Up @@ -88,17 +85,6 @@ jobs:
file.path("tests", "testthat", "test-hello.R")
)
# test NOT_CRAN envvar
brio::write_lines(
c(
"if [ \"$NOT_CRAN\" != \"true\" ]; then",
" exit 1",
"fi"
),
file.path("configure")
)
Sys.chmod("configure", "0755")
# TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html)
if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") {
error_on <- "error"
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rextendr
Title: Call Rust Code from R using the 'extendr' Crate
Version: 0.3.1.9000
Authors@R:
Version: 0.3.1.9001
Authors@R:
c(person(given = "Claus O.",
family = "Wilke",
role = "aut",
Expand Down Expand Up @@ -44,7 +44,7 @@ Imports:
cli,
desc,
dplyr,
glue,
glue (>= 1.7.0),
jsonlite,
pkgbuild (>= 1.4.0),
processx,
Expand All @@ -69,6 +69,6 @@ Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
SystemRequirements: Rust 'cargo'; the crate 'libR-sys' must compile
without error
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# Generated by roxygen2: do not edit by hand

S3method(format_toml,"NULL")
S3method(format_toml,character)
S3method(format_toml,data.frame)
S3method(format_toml,default)
S3method(format_toml,double)
S3method(format_toml,integer)
S3method(format_toml,list)
S3method(format_toml,logical)
S3method(format_toml,name)
export(clean)
export(document)
export(eng_extendr)
export(eng_extendrsrc)
export(make_module_macro)
export(read_cargo_metadata)
export(register_extendr)
export(rust_eval)
export(rust_function)
export(rust_sitrep)
export(rust_source)
export(to_toml)
export(use_cran_defaults)
export(use_crate)
export(use_extendr)
export(use_msrv)
export(vendor_pkgs)
export(write_license_note)
importFrom(dplyr,"%>%")
importFrom(dplyr,mutate)
Expand Down
15 changes: 15 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# rextendr (development version)

* `Makevars` now prints linked static libraries at compile time <https://github.com/extendr/rextendr/pull/393>
* `use_extendr()` sets the `DESCRIPTION`'s `SystemRequirements` field according to CRAN policy to `Cargo (Rust's package manager), rustc` (#329)
* Introduces new functions `use_cran_defaults()` and `vendor_pkgs()` to ease the publication of extendr-powered packages on CRAN. See the new article _CRAN compliant extendr packages_ on how to use these (#320).
* `rust_sitrep()` now better communicates the status of the Rust toolchain and available targets. It also guides the user through necessary installation steps to fix Rust setup (#318).
* `use_extendr()` and `document()` now set the `SystemRequirements` field of the `DESCRIPTION` file to
`Cargo (rustc package manager)` if the field is empty (#298).
* `use_extendr()` gets a new ability to overwrite existing rextendr templates (#292).
* `use_extendr()` sets `publish = false` in the `[package]` section of the `Cargo.toml` (#297).
* `use_extendr()` correctly handles calls with `path` not equal to `"."` (current folder), or when there is no active `{usethis}` project (#323).
* Fixes an issue in pre-defined set of known features: added `either` (#338)
* `create_extendr_package()` allows user to create project directory using RStudio's **Project Command**. (#321)
* Support `RTOOLS44` (#347)
* Removed `use_try_from` as an option in `rust_function`, and added `use_rng` (#354)
* Added `use_crate()` function to make adding dependencies to Cargo.toml easier within R, similar to `usethis::use_package()` (#361)
* Fixed an issue in `rust_source()` family of functions that prevented usage of `r#` escape sequences in Rust function names (#374)
* `use_cran_defaults()` now checks the `SystemRequirements` field in the `DESCRIPTION` file for cargo and rustc. It will display installation instructions if either is missing or provide the minimum required version if the installed version is outdated.
* Added `use_msrv()` to aid in specifying the minimum supported rust version (MSRV) for an R package
* Added `read_cargo_metadata()` to retrieve Cargo metadata for packages and
workspaces. (#389)

# rextend 0.3.1

Expand Down
Loading

0 comments on commit 19ad41b

Please sign in to comment.