From b57855db30504200d7110d45bf63cd50b61168d4 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 13:46:36 -0400 Subject: [PATCH] ci: switch to GitHub Actions - coverage display wasn't set up before, so leaving that alone in the readme for now --- .Rbuildignore | 2 - .drone.yml | 113 --------------------------------- .github/workflows/coverage.yml | 28 ++++++++ .github/workflows/main.yaml | 67 +++++++++++++++++++ README.Rmd | 2 +- README.md | 20 +++--- 6 files changed, 106 insertions(+), 126 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/main.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 5ed2887..3f6828c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,8 +3,6 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ -^.drone.yml$ -^.drone.jsonnet$ ^README\.Rmd$ ^_pkgdown\.yml$ ^docs$ diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 78ce508..0000000 --- a/.drone.yml +++ /dev/null @@ -1,113 +0,0 @@ ---- -kind: pipeline -type: docker -name: cran-latest - -platform: - os: linux - arch: amd64 - -steps: -- name: pull - image: omerxx/drone-ecr-auth - commands: - - $(aws ecr get-login --no-include-email --region us-east-1) - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - volumes: - - name: docker.sock - path: /var/run/docker.sock - -- name: "Check package: R 4.1" - pull: never - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - commands: - - R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies = TRUE)' - - R -s -e 'devtools::load_all(); sessioninfo::session_info()' - - R -s -e 'devtools::check(env_vars = c("PMF_SKIP_VDIFFR" = "true", "NOT_CRAN" = "true"))' - environment: - USER: drone - volumes: - - name: cache - path: /ephemeral - -volumes: -- name: docker.sock - host: - path: /var/run/docker.sock -- name: cache - temp: {} - -trigger: - event: - exclude: - - promote - ---- -kind: pipeline -type: docker -name: pmforest-release - -platform: - os: linux - arch: amd64 - -steps: -- name: pull - image: omerxx/drone-ecr-auth - commands: - - $(aws ecr get-login --no-include-email --region us-east-1) - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest - volumes: - - name: docker.sock - path: /var/run/docker.sock - -- name: Build package - pull: never - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest - commands: - - git config --global user.email drone@metrumrg.com - - git config --global user.name Drony - - git fetch --tags - - R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies = TRUE)' - - R -s -e 'pkgpub::create_tagged_repo(.dir = '"'"'/ephemeral'"'"')' - volumes: - - name: cache - path: /ephemeral - -- name: "Publish package: ${DRONE_TAG}" - pull: if-not-exists - image: plugins/s3 - settings: - bucket: mpn.metworx.dev - source: /ephemeral/${DRONE_TAG}/**/* - strip_prefix: /ephemeral/${DRONE_TAG}/ - target: /releases/${DRONE_REPO_NAME}/${DRONE_TAG} - volumes: - - name: cache - path: /ephemeral - -- name: "Publish package: latest_tag" - pull: if-not-exists - image: plugins/s3 - settings: - bucket: mpn.metworx.dev - source: /ephemeral/${DRONE_TAG}/**/* - strip_prefix: /ephemeral/${DRONE_TAG}/ - target: /releases/${DRONE_REPO_NAME}/latest_tag - volumes: - - name: cache - path: /ephemeral - -volumes: -- name: docker.sock - host: - path: /var/run/docker.sock -- name: cache - temp: {} - -trigger: - event: - - tag - -depends_on: -- cran-latest diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..c322c48 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage +on: + push: + branches: + - 'main' + - 'scratch/**' + pull_request: + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: release + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + upgrade: 'TRUE' + - name: Run covr + shell: Rscript {0} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: covr::codecov() diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..614fe61 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,67 @@ +name: CI +on: + push: + branches: + - 'main' + - 'scratch/**' + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+.[0-9]+' + pull_request: + +jobs: + check: + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-20.04 + r: 4.0.5 + - os: ubuntu-20.04 + r: 4.2.3 + - os: ubuntu-20.04 + r: 4.3.1 + - os: ubuntu-latest + r: release + env: + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::pkgdown + any::rcmdcheck + upgrade: 'TRUE' + - uses: r-lib/actions/check-r-package@v2 + - name: Check pkgdown + shell: Rscript {0} + run: pkgdown::check_pkgdown() + release: + if: github.ref_type == 'tag' + name: Upload release + needs: check + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: release + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgpub + - uses: metrumresearchgroup/actions/publish-r-release@v1 diff --git a/README.Rmd b/README.Rmd index 2b1bb3d..e921905 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,7 +18,7 @@ knitr::opts_chunk$set( # pmforest -[![Build Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/pmforest/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/pmforest) +[![Build Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) [![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) diff --git a/README.md b/README.md index 557d01f..a2dea93 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Build -Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/pmforest/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/pmforest) +Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) [![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) @@ -35,13 +35,13 @@ highlighted as well. ### Featured Vignettes -- [Getting - Started](https://metrumresearchgroup.github.io/pmforest/articles/getting-started.html) - – Data specifications, summarization, and basic plotting methods. -- [Multiple - Simulations](https://metrumresearchgroup.github.io/pmforest/articles/multiple-simulations.html) - – Plotting additional confidence intervals over the ‘replicate’ or - simulation run. +- [Getting + Started](https://metrumresearchgroup.github.io/pmforest/articles/getting-started.html) + – Data specifications, summarization, and basic plotting methods. +- [Multiple + Simulations](https://metrumresearchgroup.github.io/pmforest/articles/multiple-simulations.html) + – Plotting additional confidence intervals over the ‘replicate’ or + simulation run. ## Development @@ -56,8 +56,8 @@ replicate this environment, 3. open package in an R session and run `renv::init()` - - install `renv` \> 0.8.3-4 into default `.libPaths()` if not - already installed + - install `renv` \> 0.8.3-4 into default `.libPaths()` if not + already installed 4. run `pkgr install` in terminal within package directory