forked from reanahub/reana-demo-helloworld
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (136 loc) · 4.98 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# 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@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.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@v4
- 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@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-20.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 ../data . && cp ../workflow/cwl/helloworld-job.yml .
cwltool --quiet --outdir="./results" ../workflow/cwl/helloworld.cwl helloworld-job.yml
grep -q 'Hello Joe Bloggs!' results/greetings.txt
cd .. && rm -rf cwl-local-run
serial-validate:
runs-on: ubuntu-20.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-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Serial locally
uses: reanahub/reana-github-actions/local-run@v1
with:
commands: |
rm -rf results && mkdir results
docker run -i --rm -v `pwd`/code:/code -v `pwd`/data:/data -v `pwd`/results:/results docker.io/library/python:2.7-slim python /code/helloworld.py --sleeptime 0
grep -q 'Hello Joe Bloggs!' results/greetings.txt
rm -rf results
snakemake-validate:
runs-on: ubuntu-20.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-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- 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
cp -a ../code ../data .
snakemake -s ../workflow/snakemake/Snakefile --configfile ../workflow/snakemake/inputs.yaml -p --cores 1
grep -q 'Hello Joe Bloggs!' results/greetings.txt
cd .. && rm -rf snakemake-local-run
yadage-validate:
runs-on: ubuntu-20.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-20.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 ../data yadage-inputs
yadage-run . ../workflow/yadage/workflow.yaml -p sleeptime=0 -p inputfile=data/names.txt -p helloworld=code/helloworld.py -d initdir=`pwd`/yadage-inputs
grep -q 'Hello Joe Bloggs!' helloworld/greetings.txt
cd .. && rm -rf yadage-local-run