CI #115
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-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
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.head.sha }}~${{ github.event.pull_request.commits }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} | |
lint-shellcheck: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Runs shell script static analysis | |
run: | | |
sudo apt-get install shellcheck | |
./run-tests.sh --check-shellcheck | |
cwl-validate: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate CWL spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-cwl*.yaml | |
cwl-local-run: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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 ../data . && cp ../workflow/cwl/worldpopulation_job.yml . | |
cwltool --quiet --outdir="./results" ../workflow/cwl/worldpopulation.cwl worldpopulation_job.yml | |
ls -l `pwd`/results/plot.png | |
cd .. && rm -rf cwl-local-run | |
serial-validate: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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-jupyter:2.0.0 bash -c ' | |
cd /workdir && | |
mkdir -p ./results && | |
papermill ./code/worldpopulation.ipynb /dev/null \ | |
-p input_file ./data/World_historical_and_predicted_populations_in_percentage.csv \ | |
-p output_file ./results/plot.png \ | |
-p region Europe \ | |
-p year_min 1600 \ | |
-p year_max 2010' | |
ls -l `pwd`/results/plot.png | |
snakemake-validate: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate Snakemake spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-snakemake*.yaml | |
snakemake-local-run: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Run Snakemake locally | |
uses: reanahub/reana-github-actions/local-run@v1 | |
with: | |
commands: | | |
rm -rf snakemake-local-run && mkdir -p snakemake-local-run && cd snakemake-local-run | |
pip install 'pulp<2.8' snakemake papermill ipykernel pandas matplotlib | |
cp -a ../code ../data . | |
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-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate Yadage spec | |
uses: reanahub/reana-github-actions/local-validate@v1 | |
with: | |
reana_specs: reana-yadage*.yaml | |
yadage-local-run: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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 ../data yadage-inputs | |
yadage-run . ../workflow/yadage/workflow.yaml -p notebook=code/worldpopulation.ipynb -p input_file=data/World_historical_and_predicted_populations_in_percentage.csv -p region=Africa -p year_min=1500 -p year_max=2012 -d initdir=`pwd`/yadage-inputs | |
ls -l `pwd`/worldpopulation/plot.png | |
cd ..&& rm -rf yadage-local-run |