-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (59 loc) · 2.15 KB
/
action.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: KBase SDK Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '3 1 4,15 * *'
workflow_dispatch:
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:
ref: 'patch'
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 "$GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk" && echo "CI files cloned"
# Pull kb-sdk & create startup script
docker pull ghcr.io/kbase/kb_sdk_patch-develop:br-main
sed -ie "s/kbase\/kb-sdk/ghcr.io\/kbase\/kb_sdk_patch-develop:br-0.0.4/" \
"$GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk"
sed -ie "s/kbase\/kb-sdk/ghcr.io\/kbase\/kb_sdk_patch-develop:br-0.0.4/" \
"$GITHUB_WORKSPACE/kb_sdk_actions/bin/make_testdir"
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
# Configure to use CI environment
# sed -ie "s/appdev/ci/g" ./test_local/test.cfg
- name: Run tests
if: "!contains(github.event.head_commit.message, 'skip ci')"
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk test
bash <(curl -s https://codecov.io/bash)