Skip to content

Commit

Permalink
build: set up the scaffold
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Sajid Imami <[email protected]>
  • Loading branch information
AliSajid committed Dec 20, 2024
0 parents commit 250c9ae
Show file tree
Hide file tree
Showing 38 changed files with 3,559 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
\.gitkeep$
^.bumpversion.cfg$
^.lintr$
^.zenodo\.json$
^LICENSE\.md$
^Meta$
^README\.Rmd$
^\.Rproj\.user$
^\.cz\.toml$
^\.github$
^\.markdownlint\.json$
^\.markdownlintignore$
^\.pre-commit-config.yaml$
^\.travis\.yml$
^\.vscode$
^codecov\.yml$
^codemeta\.json$
^data-raw$
^doc$
^drugfindR\.Rproj$
^drugfindR\.code-workspace$
^ltex\..*$
^raw$
^renovate\.json$
^renv$
^renv\.lock$
^utilities$
9 changes: 9 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool]
[tool.commitizen]
name = "cz_conventional_commits"
version = "v0.99.558"
tag_format = "v$major.$minor.$patch"
gpg_sign = true
update_changelog_on_bump = true
changelog_incremental = false
changelog_file = "NEWS.md"
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
tests/fixtures/**/* -diff
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
33 changes: 33 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
89 changes: 89 additions & 0 deletions .github/workflows/create_github_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
push:
branches:
- devel
- RELEASE*

name: Create Github Release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@main
with:
graphite_token: ${{secrets.GRAPHITE_TOKEN}}
create-release:
runs-on: ubuntu-latest
needs: [optimize_ci]
if: needs.optimize_ci.outputs.skip == 'false'
permissions:
contents: write
outputs:
tag_version: ${{ steps.create_release.outputs.tag_version }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get most recent tag
id: get_tag
run: echo "TAG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> "$GITHUB_ENV"
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "Creating release for tag $TAG_VERSION"
gh release create $TAG_VERSION --title "Release $TAG_VERSION" --notes "Release $TAG_VERSION" --target ${{ github.ref }}
echo "tag_version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
create_release_artifacts:
needs: [create-release]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
r_version: ['release', 'devel']
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Update system repositories
run: sudo apt-get update
- name: Install system dependencies
run: |
sudo apt-get install -y libxml2-dev \
libssl-dev libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev \
pandoc
- name: Setup R
uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
with:
r-version: ${{ matrix.r_version }}
use-public-rspm: true
id: r
- name: Install dependencies
uses: r-lib/actions/setup-renv@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
- name: Build Package
run: R CMD build .
- name: Rename Package
run: echo "NEWNAME=$(./utilities/rename-package.R *.tar.gz)" >> "$GITHUB_ENV"
- name: debug
run: |
echo "R version: ${{ steps.r.outputs.installed-r-version }}"
echo "Current Tag: ${{ needs.create-release.outputs.tag_version }}"
echo "Release File Name: ${{ env.NEWNAME }}"
- name: Upload Release Artifact
env:
RELEASE_TAG: ${{ needs.create-release.outputs.tag_version }}
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ env.RELEASE_TAG }} ${{ env.NEWNAME }}
68 changes: 68 additions & 0 deletions .github/workflows/rworkflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Continuous Integration / R Workflows
on:
workflow_dispatch:
push:
branches-ignore:
- master
- main
- RELEASE_**
- graphite-**
pull_request:
branches:
- master
- main
- devel
- RELEASE_**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@main
with:
graphite_token: ${{secrets.GRAPHITE_TOKEN}}
rworkflows:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
container: ${{ matrix.config.cont }}
needs: [optimize_ci]
if: needs.optimize_ci.outputs.skip == 'false'
strategy:
fail-fast: ${{ false }}
matrix:
config:
- os: ubuntu-latest
bioc: devel
r: auto
cont: bioconductor/bioconductor_docker:devel
rspm: https://packagemanager.rstudio.com/cran/__linux__/focal/release
- os: macOS-latest
bioc: devel
r: auto
- os: windows-latest
bioc: devel
r: auto
steps:
- uses: neurogenomics/rworkflows@master
with:
run_bioccheck: ${{ true }}
run_rcmdcheck: ${{ true }}
as_cran: ${{ true }}
run_vignettes: ${{ true }}
has_testthat: ${{ true }}
run_covr: ${{ false }}
run_pkgdown: ${{ false }}
has_runit: ${{ false }}
has_latex: ${{ false }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_docker: ${{ false }}
runner_os: ${{ runner.os }}
cache_version: cache-v1
62 changes: 62 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, devel]
pull_request:
branches: [main, master, devel]

name: test-coverage

jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@main
with:
graphite_token: ${{secrets.GRAPHITE_TOKEN}}
test-coverage:
runs-on: ubuntu-latest
needs: [optimize_ci]
if: needs.optimize_ci.outputs.skip == 'false'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
Loading

0 comments on commit 250c9ae

Please sign in to comment.