From 804446e41fa2bf31ca6b4637d65b9624344a40c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 4 Feb 2021 12:36:33 +0100 Subject: [PATCH] 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. --- .github/workflows/client.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/client.yml diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml new file mode 100644 index 0000000000..6c296a8cf3 --- /dev/null +++ b/.github/workflows/client.yml @@ -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/action-docker-layer-caching@v0.0.11 + 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 -t go-build-env . + docker build --tag keep-client . + - 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 + - name: Publish Unit Test results + uses: EnricoMi/publish-unit-test-result-action@v1.7 + 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) \ No newline at end of file