Adding GHAs for building module and code QC #7
Workflow file for this run
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
name: KBase SDK Tests | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
branches: | |
- master | |
- 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 | |
env: | |
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }} | |
run: | | |
set +e | |
# 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 | |
exec 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 | |
- name: Confirm config exists and add token | |
shell: bash | |
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 | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |