Skip to content

Commit

Permalink
Merge gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleam committed May 2, 2024
2 parents bc8e8e2 + 2d401f8 commit 99223fe
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 173 deletions.
3 changes: 1 addition & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^.drone.yml$
^.drone.jsonnet$
^\.github$
^README\.Rmd$
^_pkgdown\.yml$
^docs$
Expand Down
169 changes: 0 additions & 169 deletions .drone.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI
on:
push:
branches:
- 'main'
- 'scratch/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+'
pull_request:

env:
MPN: 2024-03-01

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.1.3
- os: ubuntu-latest
r: release
env:
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
- 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 }}'
- 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
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: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN }}'
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgpub
- name: Configure Git
shell: bash
run: |
git config --global user.email CI
git config --global user.name ci@metrumrg
- name: Create output directory
shell: bash
run: echo "REPO_DIR=$(mktemp -d)" >>$GITHUB_ENV
- name: Create CRAN-like repo for release
run: pkgpub::create_tagged_repo("${{ env.REPO_DIR }}")
shell: Rscript {0}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::906087756158:role/github-actions-mpn-s3-publish
aws-region: us-east-1
- name: 'Publish package: ${{ github.ref_name }}'
run: |
aws s3 sync \
'${{ env.REPO_DIR }}/${{ github.ref_name }}/' \
's3://mpn.metworx.dev/releases/${{ github.event.repository.name }}/${{ github.ref_name }}/'
- name: 'Publish package: latest_tag'
run: |
aws s3 sync \
'${{ env.REPO_DIR }}/${{ github.ref_name }}/' \
's3://mpn.metworx.dev/releases/${{ github.event.repository.name }}/latest_tag/'
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ knitr::opts_chunk$set(

<!-- badges: start -->

[![Build Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/mpn.scorecard/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/mpn.scorecard)
[![Build Status](https://github.com/metrumresearchgroup/mpn.scorecard/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/mpn.scorecard/actions/workflows/main.yaml)
<!-- badges: end -->

`mpn.scorecard` is an R package designed to score other R packages on key attributes that help evaluate the risk of adding them to [MPN](https://mpn.metworx.com/docs/). `mpn.scorecard` leans heavily on the metrics developed by R Validation Hub's [riskmetric](https://github.com/pharmaR/riskmetric) R package, and has additional features related to the scoring and outputs. Each package is first evaluated based on code documentation, maintenance and sustainability, and transparency. Code coverage and `R CMD Check` results are then tabulated and saved out to a specified location. These metrics are summarized in a scorecard report.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- badges: start -->

[![Build
Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/mpn.scorecard/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/mpn.scorecard)
Status](https://github.com/metrumresearchgroup/mpn.scorecard/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/mpn.scorecard/actions/workflows/main.yaml)
<!-- badges: end -->

`mpn.scorecard` is an R package designed to score other R packages on
Expand Down

0 comments on commit 99223fe

Please sign in to comment.