-
Notifications
You must be signed in to change notification settings - Fork 32
174 lines (149 loc) · 4.84 KB
/
basic_sdk_functionality_tests.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Basic kb-sdk functionality tests
on:
pull_request:
branches:
- develop
- main
- master
types:
- opened
- reopened
- synchronize
- closed
jobs:
test_kb-sdk_builds:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest]
language: [perl, python, java]
test_type: [base] #, example]
auth: [token, env_var]
steps:
- name: Checkout
uses: actions/checkout@v3
# build kb-sdk from source and test basic functions
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8.0.362+9
- name: Build with Ant
run: |
make
- name: Add bin to $PATH
run: |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: checking kb-sdk functions
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
env
kb-sdk help
kb-sdk version
# the following steps create a KBase app using the SDK
# and runs some checks to ensure the app generated
# is functional and that the SDK can test it.
- name: init base repo
if: matrix.test_type == 'base'
env:
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
kb-sdk init -l $LANGUAGE_TOKEN -u user SampleApp
- name: init example repo
if: matrix.test_type == 'example'
env:
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
kb-sdk init -l $LANGUAGE_TOKEN -u user --example SampleApp
- name: test ${{ matrix.test_type }} repo, using test.cfg for auth
if: matrix.auth == 'token'
run: |
cd SampleApp
kb-sdk test || true
- name: test ${{ matrix.test_type }} repo, using test.cfg for auth, add env var to test.cfg
if: matrix.auth == 'token'
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
cd SampleApp
sed -i "s/test_token=/test_token=$KBASE_TEST_TOKEN/" test_local/test.cfg
kb-sdk test
- name: test ${{ matrix.test_type }} repo, using env var for auth
if: matrix.auth == 'env_var'
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
cd SampleApp
kb-sdk test
- name: make resulting app available as artefact in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: kbaseapp-${{ matrix.language }}-${{ matrix.test_type }}-${{ matrix.os }}
path: SampleApp
test_existing_repos:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest]
# TODO: add a Java app. WsLargeDataIO does not currently build as it relies on a Java
# repo that no longer exists.
app: [KBaseReport] # , WsLargeDataIO]
auth: [token, env_var]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8.0.362+9
- name: Build with Ant
run: |
make
- name: Add bin to $PATH
run: |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: checking basic kb-sdk functions
run: |
env
kb-sdk help
kb-sdk version
# the following steps check out and run the tests of an existing KBase app
- name: Checkout existing kbase module ${{ matrix.app }}
uses: actions/checkout@v3
with:
repository: kbaseapps/${{ matrix.app }}
path: kbase_app
- name: run repo tests, using test.cfg for auth
if: matrix.auth == 'token'
run: |
cd kbase_app
kb-sdk test || true
- name: run repo tests, using test.cfg for auth
if: matrix.auth == 'token'
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
cd kbase_app
sed -i "s/test_token=/test_token=$KBASE_TEST_TOKEN/" test_local/test.cfg
kb-sdk test
- name: run repo tests, using env var for auth
if: matrix.auth == 'env_var'
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
cd kbase_app
kb-sdk test
- name: make resulting app available as artefact in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: kbaseapp-${{ matrix.app }}-${{ matrix.os }}
path: kbase_app