Skip to content

Commit

Permalink
[CI] Ensure each yml change triggers the action (#1413)
Browse files Browse the repository at this point in the history
* Make sure each action gets triggered when the yml file gets modified

* Add R too

* Fix failed R tests
  • Loading branch information
jiayuasu committed May 14, 2024
1 parent e82a76f commit df3a36d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
- master
paths:
- 'examples/**'
- '.github/workflows/example.yml'
pull_request:
branches:
- '*'
paths:
- 'examples/**'
- '.github/workflows/example.yml'

permissions:
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'flink-shaded/**'
- 'snowflake/**'
- 'pom.xml'
- '.github/workflows/java.yml'
pull_request:
branches:
- '*'
Expand All @@ -23,6 +24,7 @@ on:
- 'flink-shaded/**'
- 'snowflake/**'
- 'pom.xml'
- '.github/workflows/java.yml'

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'spark-shaded/**'
- 'pom.xml'
- 'python/**'
- '.github/workflows/python-wheel.yml'
pull_request:
branches:
- '*'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'spark-shaded/**'
- 'pom.xml'
- 'python/**'
- '.github/workflows/python.yml'
pull_request:
branches:
- '*'
Expand All @@ -19,6 +20,7 @@ on:
- 'spark-shaded/**'
- 'pom.xml'
- 'python/**'
- '.github/workflows/python.yml'

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'spark-shaded/**'
- 'pom.xml'
- 'R/**'
- '.github/workflows/r.yml'
pull_request:
branches:
- '*'
Expand All @@ -19,6 +20,7 @@ on:
- 'spark-shaded/**'
- 'pom.xml'
- 'R/**'
- '.github/workflows/r.yml'

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
Expand Down
12 changes: 4 additions & 8 deletions R/tests/testthat/test-data-interface-raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ test_that("Passed RS_Envelope with raster", {
test_that("Passed RS_NumBands with raster", {
## Load
sdf_name <- random_string("spatial_sdf")
binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = sdf_name)
binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test3.tif"), name = sdf_name)

a <-
binary_sdf %>%
Expand All @@ -142,14 +142,11 @@ test_that("Passed RS_NumBands with raster", {
) %>%
select(nbands) %>%
collect()

expect_equal(
a %>% as.list(),
list(nbands = c(1, 1, 4))

list(nbands = c(4))
)


## Cleanup
sc %>% DBI::dbExecute(paste0("DROP TABLE ", sdf_name))
rm(a)
Expand Down Expand Up @@ -185,7 +182,7 @@ test_that("Passed RS_Value with raster", {
test_that("Passed RS_Values with raster", {
## Load
sdf_name <- random_string("spatial_sdf")
binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = sdf_name)
binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test1.tiff"), name = sdf_name)

a <-
binary_sdf %>%
Expand All @@ -195,10 +192,9 @@ test_that("Passed RS_Values with raster", {
) %>%
select(val) %>%
collect()

expect_equal(
a %>% as.list(),
list(val = list(c(255, NA_real_), c(255, NA_real_), c(NA_real_, NA_real_)))
list(val = list(c(255, NA_real_)))

)

Expand Down

0 comments on commit df3a36d

Please sign in to comment.