Skip to content

Commit

Permalink
Merge branch 'main' into feat/docker-version-manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroms authored Dec 15, 2024
2 parents f1c8502 + 4322087 commit 9655feb
Show file tree
Hide file tree
Showing 237 changed files with 9,388 additions and 25,853 deletions.
186 changes: 113 additions & 73 deletions .github/workflows/lava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,69 @@ jobs:
test-consensus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava

######################################################
### Run Consensus unitests
######################################################
- name: Lava Unit Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v ./utils/... | go-junit-report -iocopy -set-exit-code -out utils-report.xml
go test -v ./common/... | go-junit-report -iocopy -set-exit-code -out common-report.xml
go test -v ./x/... | go-junit-report -iocopy -set-exit-code -out x-report.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Consensus)
path: "*-report.xml"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava

######################################################
### Run Consensus unitests
######################################################
- name: Lava Unit Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v ./utils/... | go-junit-report -iocopy -set-exit-code -out utils-report.xml
go test -v ./common/... | go-junit-report -iocopy -set-exit-code -out common-report.xml
go test -v ./x/... | go-junit-report -iocopy -set-exit-code -out x-report.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Consensus)
path: "*-report.xml"

test-protocol:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/:$GOPATH/bin
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava

######################################################
### Run protocol unitests
######################################################
- name: Run Lava Protocol Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v ./protocol/... | go-junit-report -iocopy -set-exit-code -out protocol-report.xml
go test -v ./ecosystem/cache/... | go-junit-report -iocopy -set-exit-code -out cache-report.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Protocol)
path: "*-report.xml"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/:$GOPATH/bin
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava

######################################################
### Run protocol unitests
######################################################
- name: Run Lava Protocol Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v ./protocol/... | go-junit-report -iocopy -set-exit-code -out protocol-report.xml
go test -v ./ecosystem/cache/... | go-junit-report -iocopy -set-exit-code -out cache-report.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Protocol)
path: "*-report.xml"

test-protocol-e2e:
runs-on: ubuntu-latest
Expand All @@ -96,7 +96,7 @@ jobs:
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test ./testutil/e2e/ -run ^TestLavaProtocol$ -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out protocol-e2e-report.xml # 20mins
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -107,7 +107,7 @@ jobs:
- name: tail -n 1000 Lavad Logs
if: always()
run: tail -n 1000 testutil/e2e/protocolLogs/00_StartLava.log

- name: Print all warnings and errors from lavad
continue-on-error: true
if: always()
Expand Down Expand Up @@ -179,15 +179,15 @@ jobs:
if: always()
continue-on-error: true
run: grep "" testutil/e2e/protocolLogs/06_RPCConsumer* --include="*errors*"

- name: Upload Protocol E2E Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: Protocol E2E Logs
path: "testutil/e2e/protocolLogs/*"

# Temporarly disabled due to a bug in the signature.
# Temporarly disabled due to a bug in the signature.
# test-sdk-e2e:
# runs-on: ubuntu-latest
# steps:
Expand Down Expand Up @@ -297,14 +297,55 @@ jobs:
# if: always()
# continue-on-error: true
# run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --include="*errors*"

# - name: Upload SDK E2E Logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: SDK E2E Logs
# path: "testutil/e2e/sdkLogs/*"

# This part came from lava_sdk_tests.yml that was removed. just not to lose functionality it moved here.
# name: Lava SDK Tests

# on:
# pull_request

# jobs:
# main:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Cache dependencies
# uses: actions/cache@v4
# with:
# path: ~/.yarn
# key: yarn-${{ hashFiles('yarn.lock') }}
# restore-keys: yarn-

# - uses: actions/setup-go@v5
# with:
# go-version-file: go.mod
# cache-dependency-path: go.sum

# - uses: actions/setup-node@v4
# with:
# node-version: "21.2.0"

# - name: Init the SDK
# run: GOPATH=~/go ./scripts/init_sdk.sh -s
# working-directory: ./ecosystem/lava-sdk

# - name: ESLint
# run: ./node_modules/.bin/eslint '**/*.ts'
# working-directory: ./ecosystem/lava-sdk

# - name: Test
# run: ./node_modules/.bin/jest ./src --ci
# working-directory: ./ecosystem/lava-sdk

test-payment-e2e:
runs-on: ubuntu-latest
steps:
Expand All @@ -321,7 +362,7 @@ jobs:
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test ./testutil/e2e/ -run ^TestLavaProtocolPayment$ -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out payment-e2e-report.xml # 20mins
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -359,8 +400,8 @@ jobs:
if: always()
continue-on-error: true
run: grep "" testutil/e2e/protocolLogs/06_RPCConsumer* --include="*errors*"
- name: Upload Payment E2E Logs

- name: Upload Payment E2E Logs
if: always()
uses: actions/upload-artifact@v4
with:
Expand All @@ -369,8 +410,7 @@ jobs:

report-tests-results:
runs-on: ubuntu-latest
needs:
[
needs: [
test-consensus,
test-protocol,
test-protocol-e2e,
Expand Down Expand Up @@ -406,13 +446,13 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -468,9 +508,9 @@ jobs:
- name: Build ${{ matrix.binary }}
run: |
GOWRK=off go build -o out/${{ matrix.binary }} cmd/${{ matrix.binary }}/main.go
- name: Upload Lava Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }}
path: out/${{ matrix.binary }}
path: out/${{ matrix.binary }}
38 changes: 0 additions & 38 deletions .github/workflows/lava_sdk_tests.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.20.5
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Lint
uses: golangci/golangci-lint-action@v4
Expand Down
23 changes: 10 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@ run:
tests: true
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 7m
skip-files:
- "protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go"
- "protocol/chainlib/grpc.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go"
- "protocol/chainlib/grpcproxy/dyncodec/remotes_test.go"
- "ecosystem/lavajs/*"
- "ecosystem/lava-sdk/*"

linters:
disable-all: true
#for list of linters and what they do: https://golangci-lint.run/usage/linters/
enable:
- dogsled
- exportloopref
- copyloopvar
- gocritic
- gofumpt
- gosimple
Expand All @@ -41,6 +33,14 @@ linters:
- whitespace

issues:
exclude-files:
- "protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go"
- "protocol/chainlib/grpc.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go"
- "protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go"
- "protocol/chainlib/grpcproxy/dyncodec/remotes_test.go"
- "ecosystem/lavajs/*"
- "ecosystem/lava-sdk/*"
exclude-rules:
- text: "singleCaseSwitch"
linters:
Expand All @@ -56,7 +56,7 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- text: "SA1019:.*\"github.com/golang/protobuf/proto\" is deprecated.*" # proto is deprecated, but some places couldn't be removed
- text: 'SA1019:.*"github.com/golang/protobuf/proto" is deprecated.*' # proto is deprecated, but some places couldn't be removed
linters:
- staticcheck
- path: "migrations"
Expand All @@ -70,9 +70,6 @@ issues:
linters-settings:
dogsled:
max-blank-identifiers: 5
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
nolintlint:
allow-unused: false
require-explanation: false
Expand Down
Loading

0 comments on commit 9655feb

Please sign in to comment.