Skip to content

Commit

Permalink
combine update combined_metadata and data-raw actions (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwokaty authored Apr 23, 2021
1 parent 5b59cfe commit 2421d2b
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 61 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/data-raw.yaml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/update-curation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
schedule:
- cron: "0 5 * * 6"

name: Update curation

jobs:
update-curation:
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Restore R package cache
uses: actions/cache@v2
with:
path: /usr/local/lib/R/site-library
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Update curation
run: |
Rscript data-raw/sysdata.R
Rscript data-raw/sampleMetadata.R
- name: Test curation
id: update_curation
run: |
library("curatedMetagenomicData")
library("curatedMetagenomicDataCuration")
message(paste("\n****", Sys.time(), "Check curation ****"))
status <- "passing"
data(sampleMetadata)
tryCatch(curatedMetagenomicDataCuration::checkCuration(sampleMetadata),
warning = function(w) {
status <<- "failing"
message(paste(w, "\n"))
})
color = if (status == "passing") "brightgreen" else "red"
message(paste("::set-output name=status::", status, sep=""))
message(paste("::set-output name=color::", color, sep=""))
shell: Rscript {0}

- name: Get actions URL
id: actions_url
run: echo "::set-output name=url::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

- name: Update documentation
run: roxygen2::roxygenize()
shell: Rscript {0}

- name: Commit and create pull request for updated curation
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update curation
committer: GitHub Actions <[email protected]>
signoff: false
branch: update-curation
delete-branch: true
title: 'Update curation'
body: |
Update curation.
[![Curation Status](https://img.shields.io/badge/Curation-${{ steps.update_curation.outputs.status }}-${{ steps.update_curation.outputs.color }})](${{ steps.actions_url.outputs.url }})
Auto-generated by [create-pull-request][1].
[1]: https://github.com/peter-evans/create-pull-request
labels: automated pr
team-reviewers: |
owners
maintainers
draft: false
base: master

0 comments on commit 2421d2b

Please sign in to comment.