Skip to content

Merge pull request #98 from kbaseapps/dev-build_test_fix #50

Merge pull request #98 from kbaseapps/dev-build_test_fix

Merge pull request #98 from kbaseapps/dev-build_test_fix #50

Workflow file for this run

name: KBase SDK Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
sdk_tests:
runs-on: ubuntu-latest
steps:
- name: Check out GitHub repo
if: "!contains(github.event.head_commit.message, 'skip ci')"
uses: actions/checkout@v2
- name: Check out Actions CI files
if: "!contains(github.event.head_commit.message, 'skip ci')"
uses: actions/checkout@v2
with:
repository: 'kbaseapps/kb_sdk_actions'
path: 'kb_sdk_actions'
- name: Set up test environment
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
# Verify kb_sdk_actions clone worked
test -f "$HOME/kb_sdk_actions/bin/kb-sdk" && echo "CI files cloned"
# Pull kb-sdk & create startup script
docker pull kbase/kb-sdk
sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/make_testdir && echo "Created test_local"
test -f "test_local/test.cfg" && echo "Confirmed config exists"
- name: Configure authentication
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
# Add token to config
sed -ie "s/^test_token=.*$/&$KBASE_TEST_TOKEN/g" ./test_local/test.cfg
- name: Run tests
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
run: |
sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true