Skip to content

Adding GHAs for building module and code QC #13

Adding GHAs for building module and code QC

Adding GHAs for building module and code QC #13

Workflow file for this run

name: KBase SDK Tests
on:
pull_request:
branches:
- main
- develop
jobs:
sdk_tests:
runs-on: ubuntu-latest
steps:
- name: Check out GitHub repo
uses: actions/checkout@master
- name: Set up test environment
shell: bash
run: |
# Cache the group for the docker file
if [ ! -e $HOME/.kbsdk.cache ] ; then
docker run -i -v /var/run/docker.sock:/var/run/docker.sock --entrypoint ls ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4-rc-1 -l /var/run/docker.sock|awk '{print $4}' > $HOME/.kbsdk.cache
fi
# ignore the exit code
docker run -i --rm -v $HOME:$HOME -u $(id -u) -w $(pwd) -v /var/run/docker.sock:/var/run/docker.sock -e DUSER=$USER -e DSHELL=$SHELL --group-add $(cat $HOME/.kbsdk.cache) ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4-rc-1 test || true
- name: Confirm config exists and add token
shell: bash
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
test -f "test_local/test.cfg" && echo "Confirmed config exists"
# Add token to config
sed -ie "s/^test_token=.*$/&$KBASE_TEST_TOKEN/g" ./test_local/test.cfg
- name: Run tests
shell: bash
run: |
docker run -i --rm -v $HOME:$HOME -w $(pwd) -v /var/run/docker.sock:/var/run/docker.sock -e DSHELL=$SHELL --group-add $(cat $HOME/.kbsdk.cache) ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4-rc-1 test --verbose
- name: Upload coverage to Codecov
id: send_to_codecov
uses: codecov/codecov-action@main
continue-on-error: true
with:
files: ./python-coverage/coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}