-
Notifications
You must be signed in to change notification settings - Fork 16
52 lines (44 loc) · 1.54 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
46
47
48
49
50
51
52
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: Set up test environment
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_CI_TOKEN }}
run: |
sh scripts/GHA/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_CI_TOKEN }}
KBASE_TEST_TOKEN2: ${{ secrets.KBASE_CI_TOKEN2 }}
run: |
# Add token to config
sed -ie "s/^test_token=.*$/&$KBASE_TEST_TOKEN/g" ./test_local/test.cfg
# Change deployment env from appdev to ci
sed -ie "s+https://appdev.kbase.us+https://ci.kbase.us+g" ./test_local/test.cfg
# Add second user credentials
echo "test_token2=$KBASE_TEST_TOKEN2" >> ./test_local/test.cfg
- name: Run tests
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
run: |
sh scripts/GHA/kb-sdk test --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true