CI #169
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
# This file is part of REANA. | |
# Copyright (C) 2020, 2021, 2023, 2024 CERN. | |
# | |
# REANA is free software; you can redistribute it and/or modify it | |
# under the terms of the MIT License; see LICENSE file for more details. | |
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 7 * * 1' | |
jobs: | |
lint-commitlint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
- name: Install commitlint | |
run: | | |
npm install conventional-changelog-conventionalcommits | |
npm install commitlint@latest | |
- name: Check commit message compliance of the recently pushed commit | |
if: github.event_name == 'push' | |
run: | | |
./run-tests.sh --check-commitlint HEAD~1 HEAD | |
- name: Check commit message compliance of the pull request | |
if: github.event_name == 'pull_request' | |
run: | | |
./run-tests.sh --check-commitlint ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} | |
lint-shellcheck: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Runs shell script static analysis | |
run: | | |
sudo apt-get install shellcheck | |
./run-tests.sh --check-shellcheck | |
cwl-validate: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate CWL spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-cwl*.yaml | |
cwl-local-run: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run CWL locally | |
uses: reanahub/reana-github-actions/local-run@v1 | |
with: | |
commands: | | |
rm -rf cwl-local-run && mkdir -p cwl-local-run && cd cwl-local-run | |
pip install cwltool | |
cp -a ../code . && cp ../workflow/cwl/input.yml . | |
cwltool --quiet --outdir="./results" ../workflow/cwl/workflow.cwl input.yml | |
ls -l `pwd`/results/plot.png | |
cd .. && rm -rf cwl-local-run | |
serial-validate: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate serial spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana.yaml reana-htcondorcern.yaml reana-slurmcern.yaml | |
serial-local-run: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Serial locally | |
uses: reanahub/reana-github-actions/local-run@v1 | |
with: | |
commands: | | |
docker run -i --rm -v `pwd`:/workdir docker.io/reanahub/reana-env-root6 bash -c " | |
cd /workdir && | |
mkdir -p ./results && | |
root -b -q './code/gendata.C(20000,\"./results/data.root\")'" | |
ls -l `pwd`/results/data.root | |
docker run -i --rm -v `pwd`:/workdir docker.io/reanahub/reana-env-root6 bash -c " | |
cd /workdir && | |
root -b -q './code/fitdata.C(\"./results/data.root\",\"./results/plot.png\")'" | |
ls -l `pwd`/results/plot.png | |
snakemake-validate: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Snakemake spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-snakemake*.yaml | |
snakemake-local-run: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Snakemake locally | |
uses: reanahub/reana-github-actions/local-run@v1 | |
with: | |
commands: | | |
# Install ROOT dependencies | |
sudo apt-get update -y | |
sudo apt-get install binutils cmake dpkg-dev g++ gcc libssl-dev git libx11-dev libxext-dev libxft-dev libxpm-dev python3 libtbb-dev libvdt-dev libgif-dev | |
# Install ROOT | |
# ROOT is needed as Snakemake does not run the workflow steps in containers | |
wget -q https://root.cern/download/root_v6.32.04.Linux-ubuntu24.04-x86_64-gcc13.2.tar.gz | |
tar xfz root_v6.32.04.Linux-ubuntu24.04-x86_64-gcc13.2.tar.gz | |
source root/bin/thisroot.sh | |
rm -rf snakemake-local-run && mkdir -p snakemake-local-run && cd snakemake-local-run | |
pip install 'pulp<2.8' snakemake | |
cp -a ../code . | |
snakemake -s ../workflow/snakemake/Snakefile --configfile ../workflow/snakemake/inputs.yaml -p --cores 1 | |
ls -l `pwd`/results/plot.png | |
cd .. && rm -rf snakemake-local-run | |
yadage-validate: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Yadage spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-yadage*.yaml | |
yadage-local-run: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Yadage locally | |
uses: reanahub/reana-github-actions/local-run@v1 | |
with: | |
commands: | | |
rm -rf yadage-local-run/yadage-inputs && mkdir -p yadage-local-run/yadage-inputs && cd yadage-local-run | |
pip install yadage | |
cp -a ../code yadage-inputs | |
yadage-run . ../workflow/yadage/workflow.yaml -p events=20000 -p gendata=code/gendata.C -p fitdata=code/fitdata.C -d initdir=`pwd`/yadage-inputs | |
ls -l `pwd`/fitdata/plot.png | |
cd .. && rm -rf yadage-local-run |