-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2318 from keep-network/ci-jobs-to-github-actions-…
…migration Create GH Actions workflow for build&test of Go client As described in RFC-18, there is a need for a refactorization of Keep and tBTC release processes in order to reduce human involvment and make the processes faster and less error prone. A part of this task is migration from CircleCI jobs to GitHub Actions. This commit creates a GitHub Action workfow for building and testing Go client.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
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
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,42 @@ | ||
name: Go | ||
|
||
#TODO: extend the conditions once workflow gets tested together with other workflows | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
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: Run Docker build | ||
run: | | ||
docker build \ | ||
--target gobuild \ | ||
--tag go-build-env . | ||
docker build \ | ||
--tag keep-client . | ||
- name: Create test results directory | ||
run: | | ||
mkdir test-results | ||
- name: Run Go tests | ||
run: | | ||
docker run \ | ||
--volume $GITHUB_WORKSPACE/test-results:/mnt/test-results \ | ||
--workdir /go/src/github.com/keep-network/keep-core \ | ||
go-build-env \ | ||
gotestsum --junitfile /mnt/test-results/unit-tests.xml | ||
- 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: ./test-results/unit-tests.xml | ||
check_name: Go Test Results # name under which test results will be presented in GitHub (optional) | ||
comment_on_pr: false # turns off commenting on Pull Requests |