-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add testing on Windows, macOS, and R 4.2 #545
base: main
Are you sure you want to change the base?
Changes from all commits
dcb8834
2f9a43b
a2f3da2
0241dde
1f1488a
a3f3293
23dc802
f2af98e
b3f8269
62d61d5
e1d28e4
86a3611
c8b3734
09c02c8
e827c7f
6ada120
edbae6c
a8c175e
cd81142
e98cff9
d0a4f7b
899e2c7
17c5b84
6024d60
9bc08e2
a6581e9
fbb3354
51a899f
0b0aab9
36357c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Test Ark - Linux" | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
inputs: | ||
ssh: | ||
description: 'Set up an SSH session before running `cargo test`?' | ||
type: boolean | ||
required: true | ||
default: false | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
name: "Rust: ${{ matrix.config.rust }}, R: ${{ matrix.config.r }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { rust: 'stable', r: 'release' } | ||
# Oldest supported R version | ||
- { rust: 'stable', r: '4.2' } | ||
# Nightly rust | ||
- { rust: 'nightly', r: 'release' } | ||
timeout-minutes: 30 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@nightly | ||
if: matrix.config.rust == 'nightly' | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
use-public-rspm: true | ||
|
||
- name: Setup Build Environment | ||
run: | | ||
sudo apt-get update | ||
|
||
- name: Setup SSH access | ||
uses: mxschmitt/action-tmate@v3 | ||
if: ${{ inputs.ssh }} | ||
timeout-minutes: 30 | ||
|
||
- name: Run Unit Tests | ||
id: test | ||
run: | | ||
cargo test --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Test Ark - macOS" | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
macos: | ||
runs-on: macos-latest | ||
name: "Rust: ${{ matrix.config.rust }}, R: ${{ matrix.config.r }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { rust: 'stable', r: 'release' } | ||
timeout-minutes: 30 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
use-public-rspm: true | ||
|
||
- name: Run Unit Tests | ||
id: test | ||
run: | | ||
cargo test --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Test Ark - Windows" | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
windows: | ||
runs-on: windows-latest | ||
name: "Rust: ${{ matrix.config.rust }}, R: ${{ matrix.config.r }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { rust: 'stable', r: 'release' } | ||
timeout-minutes: 30 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
use-public-rspm: true | ||
|
||
- name: Run Unit Tests | ||
id: test | ||
run: | | ||
cargo test --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Test Ark" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test_macos: | ||
name: Test macOS | ||
uses: ./.github/workflows/test-macos.yml | ||
secrets: inherit | ||
|
||
test_windows: | ||
name: Test Windows | ||
uses: ./.github/workflows/test-windows.yml | ||
secrets: inherit | ||
|
||
test_linux: | ||
name: Test Linux | ||
uses: ./.github/workflows/test-linux.yml | ||
secrets: inherit |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,13 +327,38 @@ export_selection <- function(x, format = c("csv", "tsv", "html"), include_header | |
} | ||
|
||
write_delim <- function(x, delim, include_header) { | ||
tmp <- tempfile() | ||
defer(unlink(tmp)) | ||
path <- tempfile() | ||
defer(unlink(path)) | ||
|
||
utils::write.table(x, tmp, sep = delim, row.names = FALSE, col.names = include_header, quote = FALSE, na = "") | ||
# We use size - 1 because we don't want to read the last newline character | ||
# that creates problems when pasting the content in spreadsheets | ||
readChar(tmp, file.info(tmp)$size - 1L) | ||
write_delim_impl(x, path, delim, include_header) | ||
|
||
# We use `size - 1` because we don't want to read the last newline character | ||
# as that creates problems when pasting the content in spreadsheets. | ||
# `file.info()$size` reports the size in bytes, hence `useBytes = TRUE`. | ||
readChar(path, file.info(path)$size - 1L, useBytes = TRUE) | ||
} | ||
|
||
write_delim_impl <- function(x, path, delim, include_header) { | ||
# Scope the `con` lifetime to just this helper. | ||
# We need to `close()` the connection before we try and get the | ||
# `file.info()$size`. | ||
|
||
# Must open in binary write mode, otherwise even though we set | ||
# `eol = "\n"` on Windows it will still write `\r\n` due to the C | ||
# level `vfprintf()` call. | ||
con <- file(path, open = "wb") | ||
defer(close(con)) | ||
Comment on lines
+346
to
+350
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug found when adding Windows CI. Tests expect And the way we do |
||
|
||
utils::write.table( | ||
x = x, | ||
file = con, | ||
sep = delim, | ||
eol = "\n", | ||
row.names = FALSE, | ||
col.names = include_header, | ||
quote = FALSE, | ||
na = "" | ||
) | ||
} | ||
|
||
write_html <- function(x, include_header) { | ||
|
@@ -400,7 +425,9 @@ profile_histogram <- function(x, method = c("fixed", "sturges", "fd", "scott"), | |
|
||
# For dates, we convert back the breaks to the date representation. | ||
if (inherits(x, "POSIXct")) { | ||
bin_edges <- as.POSIXct(h$breaks, tz = attr(x, "tzone")) | ||
# Must supply an `origin` on R <= 4.2 | ||
origin <- as.POSIXct("1970-01-01", tz = "UTC") | ||
bin_edges <- as.POSIXct(h$breaks, tz = attr(x, "tzone"), origin = origin) | ||
Comment on lines
-403
to
+430
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug found when adding 4.2 CI |
||
} | ||
|
||
list( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Remove or hide behind test flag
The goal is to avoid an infinite hang on send/recv issues during kernel tests