Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Sync workflow changes to main [DEV-1816] #407

Merged
merged 15 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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