Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CNS-upgrade-go-version #1777

Merged
merged 3 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading