-
Notifications
You must be signed in to change notification settings - Fork 76
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
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8cc2e7e
Create GH Actions workflow for build&test of Go client
michalinacienciala ab6fdea
Change in a way of accessing tests results, improved readability
michalinacienciala e59dfd9
Modified conditions for workflow kick-off
michalinacienciala 5affb78
Added possibility to trigger workflow manually
michalinacienciala 372333d
Turned off publishing of test results in PR comments
michalinacienciala a368ae6
Modified incorrect naming of a step
michalinacienciala c41fb94
Temporary change to test reporting of test failures
michalinacienciala 1947d44
Revert "Temporary change to test reporting of test failures"
michalinacienciala 0504b8c
Simplified creation of test results directory
michalinacienciala 8b9bd59
Highlighting piece of code covered by GitHub Actions workflow
michalinacienciala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
- 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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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).There was a problem hiding this comment.
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.