-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (55 loc) · 2.44 KB
/
build.yaml
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
name: CWL Avro Testing
on: [push]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
# upgrade pip?
- run: sudo pip install --upgrade pip
# install a specific version of the cwl dependencies to test with
- run: pip3.10 install --user setuptools==69.0.2
- run: pip3.10 install --user cwl-runner cwltool==3.1.20230201224320 schema-salad==8.4.20230201194352 avro==1.11.3
- run: git clone https://github.com/common-workflow-language/common-workflow-language
# convert CWL schema salad CWL to standard Avro json
- run: schema-salad-tool --print-avro common-workflow-language/v1.0/CommonWorkflowLanguage.yml > cwl.avsc
# get rid of invalid avro symbols
- run: sed '/draft-3/d' cwl.avsc > cwl.edited.avsc
- run: sed -i '/draft-2/d' cwl.edited.avsc
- run: sed -i '/draft-4/d' cwl.edited.avsc
- run: sed -i '/dev4/d' cwl.edited.avsc
- run: sed -i '/v1.0/d' cwl.edited.avsc
# get rid of symbols that screw up javadoc (not sure if invalid avro schema)
- run: sed -i 's/<A>/A/g' cwl.edited.avsc
- run: sed -i 's/<B>/B/g' cwl.edited.avsc
- run: sed -i 's/<C>/C/g' cwl.edited.avsc
- run: wget https://repo1.maven.org/maven2/org/apache/avro/avro-tools/1.11.3/avro-tools-1.11.3.jar
# generate Java model classes
- run: java -jar avro-tools-1.11.3.jar compile schema cwl.edited.avsc cwl-temp
- run: ls cwl-temp # TODO: remove this
# create packages for the classes
- run: sed -i '1i package io.cwl.avro;' cwl-temp/*
- run: sed -i 's/Any/Object/g' cwl-temp/*
- run: rm cwl-temp/Any.java
- run: rm -Rf cwlavro-generated/src/main/java/io/cwl/avro
- run: cp -R cwl-temp cwlavro-generated/src/main/java/io/cwl/avro
- run: echo "the output below should show that the generated API more-or-less matches the checked-in API for convenience"
- run: git diff
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17.0.4+8'
distribution: 'adopt'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
- run: mvn -B clean install
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2