Skip to content

refactor: implemented generic flag input function and refactored config module #22

refactor: implemented generic flag input function and refactored config module

refactor: implemented generic flag input function and refactored config module #22

Workflow file for this run

name: CI/CD Develop Pipeline
on:
push:
branches:
- "develop"
pull_request:
branches:
- "feature/*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Cache npm modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache Go dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Dependencies
run: |
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install -y npm ethereum
npm install
go get -d github.com/ethereum/[email protected]
go install github.com/ethereum/go-ethereum/cmd/[email protected]
go install github.com/mattn/[email protected]
go install github.com/ory/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Run make setup for testnet
run: make setup-testnet
- name: Run gofmt
run: |
gofmt
- name: Run golangci-lint
run: |
golangci-lint run -v --timeout 5m
- name: Execute test case
run: |
go-acc ./... --ignore razor/accounts/mocks --ignore razor/cmd/mocks --ignore razor/utils/mocks --ignore pkg --ignore razor/path/mocks --output coverage.txt
- name: Run benchmarks
run: |
go test ./... -bench=. -run=^#
- name: Publish Coverage to Coveralls.io
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
- uses: bissolli/gh-action-persist-workspace@v1
with:
action: persist
push-docker-build:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop')
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get short SHA
id: sha
run: echo "::set-output name=short::$(git rev-parse --short HEAD)"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.testnet
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: razornetwork/razor-go:${{ steps.sha.outputs.short }}