From a99dcb4ca96c43c0bbd595910570500d131ccce0 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Thu, 26 May 2022 15:32:48 -0400 Subject: [PATCH] Update the PR and release pipeline --- .github/workflows/on-pr.yaml | 9 ++------- .github/workflows/publish.yaml | 3 +++ .github/workflows/tests.yml | 37 ++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 568dd10..e164ac8 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -3,10 +3,5 @@ name: Docker Build on: [pull_request] jobs: - build: - name: Run docker build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Run docker build - run: make docker-build + run-tests: + uses: ./.github/workflows/tests.yml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f2a489f..bb2954c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,9 +3,12 @@ on: release: types: [published] jobs: + run-tests: + uses: ./.github/workflows/tests.yml build: name: Run docker build runs-on: ubuntu-latest + needs: run-tests steps: - uses: actions/checkout@v2 - name: Get the version diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..17ed729 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: Tests for Geth that are used in multiple jobs. + +on: + workflow_call: + +env: + GOPATH: /tmp/go + +jobs: + build: + name: Run docker build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run docker build + run: make docker-build + + statediff-unit-test: + name: Run statediff unit tests + runs-on: ubuntu-latest + env: + GO111MODULE: on + steps: + - name: Create GOPATH + run: mkdir -p /tmp/go + + - uses: actions/setup-go@v3 + with: + go-version: ">=1.18.0" + check-latest: true + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run unit tests + run: | + make test diff --git a/Dockerfile b/Dockerfile index 5759d95..7b48184 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as builder +FROM golang:1.18-alpine as builder RUN apk --update --no-cache add make git g++ linux-headers # DEBUG