Skip to content

Commit

Permalink
ci: Sync workflow changes to main [DEV-1816] (#407)
Browse files Browse the repository at this point in the history
* Fix localnet running
* Squashed commit of the following:
* Change dispatch dependencies
* Add persist credentials to CodeQL
* Update .releaserc.json
* Update package-lock.json
* Added Docker metadata step to build
* Add updated caching and tagging in release
* Update test.yml
* Cache go setup
* Deactivate junit action
* Update dispatch.yml
* Bump go mod
* Revert changes in sync
* Reset testify

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@evernym.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@cheqd.io>
Co-authored-by: abdulla-ashurov <abdulla.ashurov@dsr-corporation.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nikitin <andrew.nikitin@cheqd.io>
Co-authored-by: Alexander Kolesov <alexandr.kolesov@dsr-corporation.com>
Co-authored-by: Alexandr Kolesov <kolesov.alex.s@gmail.com>
  • Loading branch information
6 people committed Oct 14, 2022
1 parent a19a359 commit 42a92b7
Show file tree
Hide file tree
Showing 12 changed files with 490 additions and 571 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
Expand All @@ -35,23 +36,14 @@ jobs:
name: cheqd-noded
path: dist/**/cheqd-noded

- name: Run Golang unit tests
run: go test -v ./...

build-docker:
name: "Docker image"
runs-on: ubuntu-latest
env:
DOCKER_TEST_IMAGE: ${{ github.repository }}:${{ github.sha }}
IMAGE_NAME: ${{ github.repository }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -60,6 +52,17 @@ jobs:
install: true
version: latest

- name: Configure Docker image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=raw,value=build-latest
type=sha,format=long
- name: Build image
uses: docker/build-push-action@v3
with:
Expand All @@ -68,11 +71,13 @@ jobs:
platforms: linux/amd64
load: true
target: runner
tags: ${{ env.DOCKER_TEST_IMAGE }}
outputs: type=docker,dest=/tmp/cheqd-node-image.tar
tags: ${{ steps.meta.outputs.tags }}
outputs: type=docker,dest=/tmp/cheqd-node-build.tar
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Upload Docker test image
- name: Upload Docker build image
uses: actions/upload-artifact@v3
with:
name: cheqd-node-image.tar
path: /tmp/cheqd-node-image.tar
name: cheqd-node-build.tar
path: /tmp/cheqd-node-build.tar
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- name: Build
run: make proto-gen build
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
# name: "Test"
# needs: call-build
# uses: ./.github/workflows/test.yml
# secrets: inherit

call-release:
name: "Release"
# needs: [call-test, call-build]
# needs: call-test
needs: call-build
if: ${{ github.ref_protected == true }}
uses: ./.github/workflows/release.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
with:
config-file: '.github/linters/mlc_config.json'
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'

go-lint:
# We can't use VALIDATE_GO from super linter because of this issue:
Expand All @@ -44,6 +43,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

# Node.js setup is needed to run Semantic Release
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -78,17 +79,15 @@ jobs:
name: "Docker image"
needs: release-binary
runs-on: ubuntu-latest

env:
IMAGE_NAME: ${{ github.repository }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
Expand All @@ -111,6 +110,8 @@ jobs:
latest=auto
tags: |
type=semver,pattern={{version}},value=${{ needs.release-binary.outputs.RELEASE_VERSION }}
type=raw,value=production-latest
type=sha,format=long
labels: |
org.opencontainers.image.vendor="Cheqd Foundation Limited"
org.opencontainers.image.created={{date 'dddd, MMMM Do YYYY, h:mm:ss a'}}
Expand All @@ -125,3 +126,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading

0 comments on commit 42a92b7

Please sign in to comment.