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