Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing kb_sdk tests, slimming down dockerfile #370

Merged
merged 9 commits into from
Mar 15, 2023
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