-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (38 loc) · 1.92 KB
/
kb_sdk_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: KBase SDK Tests
on:
pull_request:
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 }}