refactor: added validation on buffer percent limits #65
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/go-ethereum@v1.12.2 | |
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.12.2 | |
go install github.com/mattn/goveralls@v0.0.11 | |
go install github.com/ory/go-acc@v0.2.7 | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 | |
- 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 }} |