-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Copyright (C) 2024 Roberto Rossini ([email protected]) | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: R CMD build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- ".github/workflows/r-build.yml" | ||
- "R/**" | ||
- "src/**" | ||
- "tests/**" | ||
- "conanfile.txt" | ||
- "run_conan.py" | ||
- "DESCRIPTION" | ||
- "NAMESPACE" | ||
tags: | ||
- 'v*.*.*' | ||
|
||
pull_request: | ||
paths: | ||
- ".github/workflows/r-build.yml" | ||
- "R/**" | ||
- "src/**" | ||
- "tests/**" | ||
- "conanfile.txt" | ||
- "run_conan.py" | ||
- "DESCRIPTION" | ||
- "NAMESPACE" | ||
|
||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
CONAN_HOME: "${{ github.workspace }}/conan/" | ||
|
||
# https://stackoverflow.com/a/72408109 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
r-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate requirements.txt | ||
run: | | ||
echo 'conan>=2' > requirements.txt | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: 'pip' | ||
|
||
- name: Install Conan | ||
run: pip install -r requirements.txt | ||
|
||
- name: Install pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: 'release' | ||
|
||
- name: Build package | ||
run: R CMD build . | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: package | ||
path: hictk_*.tar.gz | ||
if-no-files-found: 'error' | ||
retention-days: 7 | ||
compression-level: 0 | ||
|
||
|
||
ci-status-check: | ||
name: Status Check (R CMD build) | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- r-build | ||
|
||
steps: | ||
- name: Collect job results | ||
if: needs.r-build.result != 'success' | ||
run: exit 1 |