Skip to content

Commit

Permalink
Merge branch 'main' into PRT-replace-cookbook-with-lava-config
Browse files Browse the repository at this point in the history
  • Loading branch information
shleikes authored Dec 15, 2024
2 parents b9487be + 00d0c46 commit 1a6e53a
Show file tree
Hide file tree
Showing 23 changed files with 176 additions and 165 deletions.
209 changes: 104 additions & 105 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,54 +297,54 @@ 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
# This part came from lava_sdk_tests.yml that was removed. just not to lose functionality it moved here.
# name: Lava SDK Tests

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

# - name: Cache dependencies
# uses: actions/cache@v4
# with:
# path: ~/.yarn
# key: yarn-${{ hashFiles('yarn.lock') }}
# restore-keys: yarn-
# jobs:
# main:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

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

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

# - name: Init the SDK
# run: GOPATH=~/go ./scripts/init_sdk.sh -s
# working-directory: ./ecosystem/lava-sdk
# - uses: actions/setup-node@v4
# with:
# node-version: "21.2.0"

# - name: ESLint
# run: ./node_modules/.bin/eslint '**/*.ts'
# working-directory: ./ecosystem/lava-sdk
# - name: Init the SDK
# run: GOPATH=~/go ./scripts/init_sdk.sh -s
# working-directory: ./ecosystem/lava-sdk

# - name: Test
# run: ./node_modules/.bin/jest ./src --ci
# 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
Expand All @@ -362,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 @@ -400,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 @@ -410,8 +410,7 @@ jobs:

report-tests-results:
runs-on: ubuntu-latest
needs:
[
needs: [
test-consensus,
test-protocol,
test-protocol-e2e,
Expand Down Expand Up @@ -447,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 @@ -509,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 }}
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
13 changes: 1 addition & 12 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 Down Expand Up @@ -78,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
5 changes: 4 additions & 1 deletion config/provider_examples/avalanch_internal_paths_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ endpoints:
network-address:
address: 127.0.0.1:2221
node-urls:
- url: ws://127.0.0.1:3333/C/rpc/ws
- url: ws://127.0.0.1:3333/C/ws
internal-path: "/C/rpc" # c chain like specified in the spec

- url: https://127.0.0.1:3334/C/rpc
internal-path: "/C/rpc" # c/rpc like specified in the spec
- url: https://127.0.0.1:3334/C/avax
internal-path: "/C/avax" # c/avax like specified in the spec
- url: https://127.0.0.1:3335/X
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/lavanet/lava/v4

go 1.20
go 1.23

require (
github.com/99designs/keyring v1.2.1 // indirect
Expand Down
Loading

0 comments on commit 1a6e53a

Please sign in to comment.