Skip to content

Commit

Permalink
Update workflow skippers, nd add style check workflow (#49)
Browse files Browse the repository at this point in the history
[skip version] [skip validation] [skip style] [skip spelling]
  • Loading branch information
cicdguy authored Jan 29, 2022
1 parent 6a3f558 commit ca64463
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest
name: oysteR scan 🦪
if: "! contains(toJSON(github.event.commits.*.message), '[skip audit]')"
if: "! contains(github.event.commits[0].message, '[skip audit]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bioccheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
tag: latest
name: ${{ matrix.config.image }}, version ${{ matrix.config.tag }}
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip bioccheck]') && contains(inputs.enable-bioccheck, 'true')"
if: "! contains(github.event.commits[0].message, '[skip bioccheck]') && contains(inputs.enable-bioccheck, 'true')"
container:
image: ${{ matrix.config.image }}:${{ matrix.config.tag }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
tag: latest
name: ${{ matrix.config.image }}, version ${{ matrix.config.tag }}
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip r-cmd]')"
if: "! contains(github.event.commits[0].message, '[skip r-cmd]')"
container:
image: ${{ matrix.config.image }}:${{ matrix.config.tag }}

Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
name: Upload build tar.gz
needs: build-install-check
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v') && (! contains(toJSON(github.event.commits.*.message), '[skip r-cmd]'))"
if: "startsWith(github.ref, 'refs/tags/v') && (! contains(github.event.commits[0].message, '[skip r-cmd]'))"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
gitleaks:
name: gitleaks 💧
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip gitleaks]')"
if: "! contains(github.event.commits[0].message, '[skip gitleaks]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
license:
runs-on: ubuntu-latest
name: Check 🚩
if: "! contains(toJSON(github.event.commits.*.message), '[skip licenses]')"
if: "! contains(github.event.commits[0].message, '[skip licenses]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
linkChecker:
name: Validate Links 🔎
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip links]')"
if: "! contains(github.event.commits[0].message, '[skip links]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
lint:
name: SuperLinter 🦸‍♂️
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip linter]')"
if: "! contains(github.event.commits[0].message, '[skip linter]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
pkgdown:
name: Generate 🐣
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip docs]')"
if: "! contains(github.event.commits[0].message, '[skip docs]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
release:
name: Release 🚀
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip release]')"
if: "! contains(github.event.commits[0].message, '[skip release]')"
permissions:
contents: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/roxygen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
man-pages:
name: Manual pages check 🏁
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip roxygen]')"
if: "! contains(github.event.commits[0].message, '[skip roxygen]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
spelling:
name: Check spelling 🔠
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip spelling]')"
if: "! contains(github.event.commits[0].message, '[skip spelling]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Style 🎽

on:
push:
branches:
- main
- pre-release
pull_request:
branches:
- main
- pre-release
workflow_call:

jobs:
style:
name: Check code style 🔠
runs-on: ubuntu-latest
if: "! contains(github.event.commits[0].message, '[skip style]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest

steps:
- name: Checkout Code 🛎
uses: actions/checkout@v2
with:
path: ${{ github.event.repository.name }}

- name: Install styler 👚
run: |
if (!require("styler")) install.packages("styler", repos="http://cran.rstudio.com/")
shell: Rscript {0}

- name: Run styler 👟
run: styler::style_pkg("${{ github.event.repository.name }}", dry = "fail")
shell: Rscript {0}
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
test-coverage:
name: Coverage 📔
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip coverage]')"
if: "! contains(github.event.commits[0].message, '[skip coverage]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
r-pkg-validation:
name: Create report 📃
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip validation]')"
if: "! contains(github.event.commits[0].message, '[skip validation]')"
container:
image: ghcr.io/insightsengineering/rstudio_4.1.2_bioc_3.14:latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
version-bump:
name: Bump version ⤴
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip vbump]')"
if: "! contains(github.event.commits[0].message, '[skip vbump]')"
container:
image: docker.io/rocker/tidyverse:4.1.2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
version-check:
name: Version check 🏁
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip version]')"
if: "! contains(github.event.commits[0].message, '[skip version]')"
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[![Release](https://github.com/insightsengineering/r.pkg.template/actions/workflows/release.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/release.yaml)
[![Roxygen](https://github.com/insightsengineering/r.pkg.template/actions/workflows/roxygen.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/roxygen.yaml)
[![Spelling](https://github.com/insightsengineering/r.pkg.template/actions/workflows/spelling.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/spelling.yaml)
[![Style](https://github.com/insightsengineering/r.pkg.template/actions/workflows/style.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/style.yaml)
[![SuperLinter](https://github.com/insightsengineering/r.pkg.template/actions/workflows/linter.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/linter.yaml)
[![Version bump](https://github.com/insightsengineering/r.pkg.template/actions/workflows/version-bump.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/version-bump.yaml)
[![Version check](https://github.com/insightsengineering/r.pkg.template/actions/workflows/version.yaml/badge.svg)](https://github.com/insightsengineering/r.pkg.template/actions/workflows/version.yaml)
Expand All @@ -20,6 +21,7 @@
[![Current Version](https://img.shields.io/github/r-package/v/insightsengineering/r.pkg.template/main?color=purple&label=Version@main)](https://github.com/insightsengineering/r.pkg.template/tree/main)
[![Open Issues](https://img.shields.io/github/issues-raw/insightsengineering/r.pkg.template?color=red&label=Open%20Issues)](https://github.com/insightsengineering/r.pkg.template/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)

<!-- links -->
[pre-commit]: https://pre-commit.com
[pre-commit installation]: https://pre-commit.com/#installation
[git hooks]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Expand Down

0 comments on commit ca64463

Please sign in to comment.