-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into adjust_repr_use
- Loading branch information
Showing
4 changed files
with
178 additions
and
239 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.