-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
159 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,4 +147,4 @@ jobs: | |
|
||
- uses: ./.github/workflows/check | ||
with: | ||
results: ${{ matrix.package }} | ||
results: ${{ matrix.package }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'Update status' | ||
description: 'Update status' | ||
inputs: | ||
sha: | ||
description: 'SHA to update' | ||
required: true | ||
state: | ||
description: 'state to update' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# It's difficult to get the URL of the current job. | ||
# The /jobs API and/or the `github` context are misaligned. | ||
# The duckdbneo repository contains several failed attempts. | ||
- run: | | ||
set -x | ||
if [ -n '${{ inputs.sha }}' ]; then | ||
export GH_TOKEN=${{ github.token }} | ||
html_url=$(gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url) | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/statuses/${{ inputs.sha }} \ | ||
-f "state=${{ job.status }}" -f "target_url=$html_url" -f "description=${{ github.workflow }} / ${{ github.job }}" -f "context=actions-sync" | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Actions to read a matrix with all R and OS versions, computed with the versions-matrix action" | ||
outputs: | ||
matrix: | ||
description: "Generated matrix" | ||
value: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install json2yaml | ||
run: | | ||
sudo npm install -g json2yaml | ||
shell: bash | ||
|
||
- id: set-matrix | ||
run: | | ||
matrix=$(cat .github/versions-matrix.json || echo '{"include":[]}') | ||
echo $matrix | jq . | ||
echo $matrix | json2yaml | ||
echo "matrix=$matrix" | tee -a $GITHUB_OUTPUT | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# FIXME: Dynamic lookup by parsing https://svn.r-project.org/R/tags/ | ||
r_versions <- c("devel", paste0("4.", 4:0)) | ||
macos <- data.frame(os = "macos-latest", r = r_versions[2:3]) | ||
windows <- data.frame(os = "windows-latest", r = r_versions[1:3]) | ||
linux_devel <- data.frame(os = "ubuntu-22.04", r = r_versions[1], `http-user-agent` = "release", check.names = FALSE) | ||
linux <- data.frame(os = "ubuntu-22.04", r = r_versions[-1]) | ||
covr <- data.frame(os = "ubuntu-22.04", r = r_versions[2], covr = "true", desc = "with covr") | ||
|
||
include_list <- list(macos, windows, linux_devel, linux, covr) | ||
print(include_list) | ||
|
||
filter <- read.dcf("DESCRIPTION")[1,]["Config/gha/filter"] | ||
if (!is.na(filter)) { | ||
filter_expr <- parse(text = filter)[[1]] | ||
subset_fun_expr <- bquote(function(x) subset(x, .(filter_expr))) | ||
subset_fun <- eval(subset_fun_expr) | ||
include_list <- lapply(include_list, subset_fun) | ||
print(include_list) | ||
} | ||
|
||
to_json <- function(x) { | ||
if (nrow(x) == 0) return(character()) | ||
parallel <- vector("list", length(x)) | ||
for (i in seq_along(x)) { | ||
parallel[[i]] <- paste0('"', names(x)[[i]], '":"', x[[i]], '"') | ||
} | ||
paste0("{", do.call(paste, c(parallel, sep = ",")), "}") | ||
} | ||
|
||
configs <- unlist(lapply(include_list, to_json)) | ||
json <- paste0('{"include":[', paste(configs, collapse = ","), ']}') | ||
|
||
writeLines(json, ".github/versions-matrix.json") | ||
writeLines(json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: "Actions to compute a matrix with all R and OS versions" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: set-matrix | ||
run: | | ||
Rscript ./.github/workflows/versions-matrix/action.R | ||
shell: bash |