From 33546b24acee8a3b4f20108d69d753eb06c02d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Li=C3=A9tar?= Date: Mon, 30 Sep 2024 16:14:01 +0100 Subject: [PATCH] Switch from buildkite to GitHub actions. We now have the ability to connect to Packit directly from GitHub actions, which removes the need to use our internal Buildkite infrastructure. --- .buildkite/Dockerfile | 11 ----- .buildkite/pipeline.R | 27 ----------- .buildkite/pipeline.sh | 11 ----- .buildkite/pipeline.yml | 4 -- .buildkite/pkgdepends.txt | 48 ------------------- .github/workflows/test.yaml | 92 +++++++++++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 101 deletions(-) delete mode 100644 .buildkite/Dockerfile delete mode 100644 .buildkite/pipeline.R delete mode 100755 .buildkite/pipeline.sh delete mode 100644 .buildkite/pipeline.yml delete mode 100644 .buildkite/pkgdepends.txt create mode 100644 .github/workflows/test.yaml diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile deleted file mode 100644 index 082e8998..00000000 --- a/.buildkite/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM rocker/r-ver:4 - -RUN Rscript -e 'install.packages("pak")' - -# For some reason pak fails to install urltools -RUN Rscript -e 'install.packages("urltools")' - -COPY .buildkite/pkgdepends.txt /src/.buildkite/pkgdepends.txt -RUN Rscript -e 'pak::pkg_install(readLines("/src/.buildkite/pkgdepends.txt"))' - -COPY . /src diff --git a/.buildkite/pipeline.R b/.buildkite/pipeline.R deleted file mode 100644 index b1b952ce..00000000 --- a/.buildkite/pipeline.R +++ /dev/null @@ -1,27 +0,0 @@ -library(orderly2) - -orderly_init() -orderly_location_add( - "packit.dide", - type = "packit", - args = list( - url = "https://packit.dide.ic.ac.uk/priority-pathogens", - token = Sys.getenv("GITHUB_TOKEN")) -) - -orderly_location_pull_metadata("packit.dide") -orderly_location_pull_packet("latest(name == 'db_extraction' && parameter:pathogen == 'LASSA')", - options = list(location="packit.dide")) - -ids <- c( - orderly_run("db_double", parameters = list(pathogen = "LASSA")), - orderly_run("db_compilation", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_serology", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_severity", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_delays", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_transmission", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_summary", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_latex_tables", parameters = list(pathogen = "LASSA")), - orderly_run("lassa_collate", parameters = list(pathogen = "LASSA"))) - -orderly_location_push(ids, "packit.dide") diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh deleted file mode 100755 index 0434ba22..00000000 --- a/.buildkite/pipeline.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -PACKAGE_ORG=mrc-ide -PACKAGE_NAME=priority-pathogen -GIT_SHA=${BUILDKITE_COMMIT:0:7} -TAG_SHA=$PACKAGE_ORG/$PACKAGE_NAME:$GIT_SHA - -docker build -t $TAG_SHA --progress=plain -f .buildkite/Dockerfile . -docker run -e GITHUB_TOKEN --rm -w /src $TAG_SHA Rscript /src/.buildkite/pipeline.R diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index d624174f..00000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,4 +0,0 @@ -steps: - - command: .buildkite/pipeline.sh - agents: - queue: "paul" diff --git a/.buildkite/pkgdepends.txt b/.buildkite/pkgdepends.txt deleted file mode 100644 index 4793860c..00000000 --- a/.buildkite/pkgdepends.txt +++ /dev/null @@ -1,48 +0,0 @@ -mrc-ide/orderly2 -mrc-ide/orderly.sharedfile -mrc-ide/epireview -cowplot -doconv -dplyr -epitrix -estmeansd -flextable -ftExtra -ggbreak -ggforce -ggplot2 -ggrepel -ggsci -ggspatial -grid -gridExtra -gt -harrypotter -ids -janitor -meta -metafor -mixdist -odbc -officer -optparse -patchwork -png -purrr -ragg -readr -readxl -rio -rnaturalearth -rnaturalearthdata -scales -sf -snakecase -splitstackshape -stringr -tibble -tidyr -tidyverse -tm -writexl -zip diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..3bc594e4 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,92 @@ +on: + - push + - pull_request + +jobs: + lassa: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + extra-repositories: | + https://mrc-ide.r-universe.dev + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: NA + packages: | + mrc-ide/epireview + orderly.sharedfile + cowplot + doconv + dplyr + epitrix + estmeansd + flextable + ftExtra + ggbreak + ggforce + ggplot2 + ggrepel + ggsci + ggspatial + grid + gridExtra + gt + harrypotter + ids + janitor + meta + metafor + mixdist + odbc + officer + optparse + patchwork + png + purrr + ragg + readr + readxl + rio + rnaturalearth + rnaturalearthdata + scales + sf + snakecase + splitstackshape + stringr + tibble + tidyr + tidyverse + tm + writexl + zip + + - uses: mrc-ide/orderly-action@main + with: + packit-url: https://packit.dide.ic.ac.uk/priority-pathogens + + - shell: Rscript {0} + run: | + library(orderly2) + orderly_location_pull_packet("latest(name == 'db_extraction' && parameter:pathogen == 'LASSA')", + options = list(location="packit")) + + ids <- c( + orderly_run("db_double", parameters = list(pathogen = "LASSA")), + orderly_run("db_compilation", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_serology", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_severity", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_delays", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_transmission", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_summary", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_latex_tables", parameters = list(pathogen = "LASSA")), + orderly_run("lassa_collate", parameters = list(pathogen = "LASSA"))) + + orderly_location_push(ids, "packit")