From 81ea4bbfcfba86af363dd9da37e71cbb9451f06c Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 24 Feb 2021 23:17:36 +0300 Subject: [PATCH 1/3] core: update oracle test It is failing from time to time. --- pkg/core/oracle_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/oracle_test.go b/pkg/core/oracle_test.go index 8545bf3fa..efdf749f1 100644 --- a/pkg/core/oracle_test.go +++ b/pkg/core/oracle_test.go @@ -280,7 +280,7 @@ func TestOracleFull(t *testing.T) { putOracleRequest(t, cs.Hash, bc, "http://get.1234", new(string), "handle", []byte{}, 10_000_000) require.Eventually(t, func() bool { return mp.Count() == 1 }, - time.Second*2, time.Millisecond*200) + time.Second*3, time.Millisecond*200) txes := mp.GetVerifiedTransactions() require.Len(t, txes, 1) From 7dfdbcd4560dccf0743f0f8ddb543b45e44f31cf Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 24 Feb 2021 15:23:02 +0300 Subject: [PATCH 2/3] github: setup github workflow to publish to DockerHub This workflow tags and publishes images to Dockerhub: * Every `push` to `master` branch * Every release For successful workflow runs the following secrets need to be set in the repository `Secrets` section: * `DOCKERHUB_USERNAME` - the username to publish images to DockerHub * `DOCKERHUB_PASSWORD` - the password of `DOCKERHUB_USERNAME` --- .github/workflows/publish_to_dockerhub.yml | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/publish_to_dockerhub.yml diff --git a/.github/workflows/publish_to_dockerhub.yml b/.github/workflows/publish_to_dockerhub.yml new file mode 100644 index 000000000..54bef723e --- /dev/null +++ b/.github/workflows/publish_to_dockerhub.yml @@ -0,0 +1,89 @@ +name: Push images to DockerHub + +# Controls when the action will run. +on: + push: + # Publish `master` as Docker `latest` and `git_revision` images. + branches: + - master + release: + # Publish released commit as Docker `latest` and `git_revision` images. + types: + - published + + # Allows to run this workflow manually from the Actions tab. + workflow_dispatch: + +# Environment variables. +env: + GO111MODULE: "on" + +# A workflow run. +jobs: + test: + name: Run tests before publishing + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Sync VM submodule + run: | + git submodule sync + git submodule update --init + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Restore go modules from cache + uses: actions/cache@v2 + with: + path: /go/pkg/mod + key: deps-${{ hashFiles('go.sum') }} + + - name: Update Go modules + run: go mod download + + - name: Run tests + run: make test + publish: + # Ensure test job passes before pushing image. + needs: test + name: Publish image to DockerHub + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + # Allows to fetch all history for all branches and tags. Need this for proper versioning. + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Restore go modules from cache + uses: actions/cache@v2 + with: + path: /go/pkg/mod + key: deps-${{ hashFiles('go.sum') }} + + - name: Update Go modules + run: go mod download + + - name: Build images + run: make image + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Push images to registry + run: make image-push From a1245cd381041fe4122add82e11468a8a438d883 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 25 Feb 2021 14:54:14 +0300 Subject: [PATCH 3/3] github: publish only released images --- .github/workflows/publish_to_dockerhub.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_to_dockerhub.yml b/.github/workflows/publish_to_dockerhub.yml index 54bef723e..8cd6c2c1d 100644 --- a/.github/workflows/publish_to_dockerhub.yml +++ b/.github/workflows/publish_to_dockerhub.yml @@ -85,5 +85,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Push images to registry + - name: Push released images to registry + if: ${{ github.event_name == 'release' }} run: make image-push