Skip to content

Commit

Permalink
Add workflow to package hictk
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Feb 26, 2024
1 parent f37331b commit fdcdca0
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/r-build.yml
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

0 comments on commit fdcdca0

Please sign in to comment.