Skip to content

Commit

Permalink
Merge branch 'develop' into adjust_repr_use
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Mar 15, 2023
2 parents 89e620e + 2501e08 commit ad8134e
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 239 deletions.
174 changes: 174 additions & 0 deletions .github/workflows/basic_sdk_functionality_tests.yml
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
187 changes: 0 additions & 187 deletions .github/workflows/kb_sdk-actions.yml

This file was deleted.

Loading

0 comments on commit ad8134e

Please sign in to comment.