Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix kb-sdk #210

Merged
merged 10 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions .github/workflows/kb_sdk_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,13 @@ jobs:
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:
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_CI_TOKEN }}
run: |
# Verify kb_sdk_actions clone worked
test -f "$HOME/kb_sdk_actions/bin/kb-sdk" && echo "CI files cloned"
# Pull kb-sdk & create startup script
docker pull kbase/kb-sdk

sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/make_testdir && echo "Created test_local"
sh scripts/GHA/make_testdir && echo "Created test_local"
test -f "test_local/test.cfg" && echo "Confirmed config exists"

- name: Configure authentication
Expand All @@ -55,10 +42,8 @@ jobs:
- 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
sh scripts/GHA/kb-sdk test --verbose

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
12 changes: 12 additions & 0 deletions scripts/GHA/kb-sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# TODO may want to make the image an env var or argument

# See https://github.com/kbaseapps/kb_sdk_actions/blob/master/bin/kb-sdk for source

# 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 -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 $@
16 changes: 16 additions & 0 deletions scripts/GHA/make_testdir
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# TODO may want to make the image an env var or argument

# See https://github.com/kbaseapps/kb_sdk_actions/blob/master/bin/make_testdir for source

# Disable the default `return 1` when creating `test_local`
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
exit
Loading