From 6950c217ece5241536e87e801f2821379d8640bc Mon Sep 17 00:00:00 2001 From: anderson Date: Wed, 22 May 2024 14:18:22 -0400 Subject: [PATCH 1/2] prep for github action --- .Rbuildignore | 2 +- .drone.yml | 163 ------------------------------------ .github/workflows/main.yaml | 73 ++++++++++++++++ README.Rmd | 3 +- README.md | 3 +- 5 files changed, 76 insertions(+), 168 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/main.yaml diff --git a/.Rbuildignore b/.Rbuildignore index e0db2731..420c762d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,7 +9,7 @@ pkgr.yml ^.*\.Rproj$ ^man-roxygen$ ^README\.Rmd$ -^.drone.yml$ +^\.github$ make-R.R inst/example-sdtm-large-ae inst/example-sdtm-large-lb diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 189e33d5..00000000 --- a/.drone.yml +++ /dev/null @@ -1,163 +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:subversion - 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:subversion - 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("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: mrgda-coverage - -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:subversion - volumes: - - name: docker.sock - path: /var/run/docker.sock - - -- name: Code coverage - pull: never - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:subversion - commands: - - R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')' - - R -s -e 'covr::codecov()' - environment: - CODECOV_TOKEN: - from_secret: CODECOV_TOKEN - NOT_CRAN: true - volumes: - - name: cache - path: /ephemeral - -volumes: -- name: docker.sock - host: - path: /var/run/docker.sock -- name: cache - temp: {} - -trigger: - event: - exclude: - - promote - -depends_on: -- cran-latest - - ---- -kind: pipeline -type: docker -name: 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/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..fff62e20 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,73 @@ +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 }} R ${{ matrix.config.r }} ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-20.04 + r: 4.0.5 + - os: ubuntu-20.04 + r: 4.1.3 + - os: ubuntu-latest + r: release + env: + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - name: Install subversion + shell: bash + run: sudo apt-get install subversion + - 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 + with: + error-on: '"note"' + - 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 + - name: Install subversion + shell: bash + run: sudo apt-get install subversion + - 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 89eb4ebb..86b6288c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,8 +16,7 @@ knitr::opts_chunk$set( # mrgda -[![Build Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/mrgda/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/mrgda) -[![codecov](https://codecov.io/gh/metrumresearchgroup/mrgda/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/mrgda) +[![Build Status](https://github.com/metrumresearchgroup/mrgda/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/mrgda/actions/workflows/main.yaml) ## Overview diff --git a/README.md b/README.md index aebfd3bd..17527b1c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ [![Build -Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/mrgda/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/mrgda) -[![codecov](https://codecov.io/gh/metrumresearchgroup/mrgda/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/mrgda) +Status](https://github.com/metrumresearchgroup/mrgda/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/mrgda/actions/workflows/main.yaml) ## Overview From 7dadf5fa55c5c089b136adad43ae55d630ec9972 Mon Sep 17 00:00:00 2001 From: anderson Date: Wed, 22 May 2024 14:24:34 -0400 Subject: [PATCH 2/2] remove note error --- .github/workflows/main.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fff62e20..03e03f71 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -43,8 +43,6 @@ jobs: any::rcmdcheck upgrade: 'TRUE' - uses: r-lib/actions/check-r-package@v2 - with: - error-on: '"note"' - name: Check pkgdown shell: Rscript {0} run: pkgdown::check_pkgdown()