diff --git a/.circleci/config.yml b/.circleci/config.yml index 15b89b3bb6..b5f0b10b2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,6 +36,7 @@ jobs: root: /tmp/docs paths: - solidity/* + # GitHub Actions equivalent of this job (.github/workflows/client.yml) has been created as part of work on RFC-18 build_client_and_test_go: executor: docker-git steps: diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml new file mode 100644 index 0000000000..a10ea09c23 --- /dev/null +++ b/.github/workflows/client.yml @@ -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/action-docker-layer-caching@v0.0.11 + 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/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: ./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