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

Create GH Actions workflow for build&test of Go client #2318

Merged
merged 10 commits into from
Feb 10, 2021
30 changes: 30 additions & 0 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go

#TODO: extend the conditions once workflow gets tested together with other workflows
on: [push, pull_request]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: satackey/[email protected]
continue-on-error: true # ignore the failure of a step and avoid terminating the job
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll flag that the comment here mostly seems to be repeating what the flag already communicates (unlike if: always() which isn't as obvious).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I'm not changing it though, as this fragment of code will be removed once #2331 gets merged to master.

- name: Create test results directory
run: |
mkdir -p /tmp/test-results/keep-core-go
- name: Run Docker build
run: |
docker build --target gobuild --tag go-build-env .
docker build --tag keep-client .
nkuba marked this conversation as resolved.
Show resolved Hide resolved
- name: Run Go tests
run: |
docker run --volume /tmp/test-results/keep-core-go:/mnt/test-results --workdir /go/src/github.com/keep-network/keep-core go-build-env gotestsum --junitfile /mnt/test-results/unit-tests.xml
docker run --volume /tmp/test-results/keep-core-go:/mnt/test-results --workdir /go/src/github.com/keep-network/keep-core go-build-env cat /mnt/test-results/unit-tests.xml > ./unit-tests.xml
michalinacienciala marked this conversation as resolved.
Show resolved Hide resolved
- name: Publish Unit Test results
uses: EnricoMi/[email protected]
if: always() # guarantees that this action always runs, even if earlier steps fail
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: unit-tests.xml
check_name: Go Test Results # name under which test results will be presented in GitHub (optional)