-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (57 loc) · 1.79 KB
/
miniwdl-check.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
#
# This workflow will run on Pushes and Pull Requests against the main branch. It
# will only run "miniwdl check" on wdl files that have had a change in the push
# or PR.
#
name: MiniWDL Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
# Expose workflows with changes
workflows: ${{ steps.filter.outputs.wf }}
workflows_files: ${{ steps.filter.outputs.wf_files }}
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Select wdl files with changes
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
wf:
- added|modified: 'tasks/**'
- added|modified: 'workflows/**'
list-files: json
check:
runs-on: ubuntu-20.04
name: ${{ matrix.wf }}
needs: changes
if: ${{ needs.changes.outputs.workflows != '' && toJson(fromJson(needs.changes.outputs.workflows)) != '[]' }}
strategy:
fail-fast: false
matrix:
wf: ${{ fromJson(needs.changes.outputs.workflows_files) }}
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Install a version of Python3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
# Install MiniWDL (WDL syntax) and ShellCheck (shell syntax)
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get -y install shellcheck
pip3 -q install miniwdl 'importlib-metadata==4.13.0'
# Run MiniWDL check on each of the changed WDLs
- name: MiniWDL Check ${{ matrix.wf }}
run: miniwdl check ${{ matrix.wf }}