Sign image #9342
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: Validate | |
# This workflow validates that the project builds and passes tests | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- name: Go Mod Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./... | |
- name: Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-report-linux | |
path: report.xml | |
cli-test: | |
name: CLI Integration Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- name: Go Mod Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Build | |
run: go build ./cmd/accumulated | |
- name: Init main | |
run: ./accumulated init -w .nodes -n EastXeons -r EastXeons | |
# - name: Init follower | |
# run: | | |
# rm -rf .nodes | |
# ./accumulated init follower -w .nodes -n EastXeons -l tcp://127.0.2.1:3000 | |
# - name: Run follower | |
# run: ./accumulated run -w .nodes/Node0 --ci-stop-after 5s | |
- name: Init localhost | |
run: | | |
rm -rf .nodes | |
./accumulated testnet -w .nodes -v 1 -f 0 --no-empty-blocks | |
# - name: Run and load test localhost | |
# run: | | |
# ./accumulated run -w .nodes/Node0 & | |
# PID=$! | |
# sleep 5 | |
# ./accumulated loadtest -r tcp://127.0.1.1:26657 --wallets 10 --transactions 10 | |
# kill -9 $PID | |
build-windows: | |
name: Build Windows | |
runs-on: windows-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- name: Go Mod Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./... | |
- name: Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-report-windows | |
path: report.xml | |
build-macos: | |
name: Build macOS | |
runs-on: macos-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- name: Go Mod Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./... | |
- name: Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-report-macos | |
path: report.xml |