Skip to content

Commit

Permalink
merged with main
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecot committed Aug 26, 2024
2 parents 656c7dd + 395a054 commit 2a33633
Show file tree
Hide file tree
Showing 1,172 changed files with 83,539 additions and 56,137 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ go.work
go.work.sum
*.md

Dockerfile
Dockerfile
docker/docker-compose.*
cmd/**/Dockerfile
247 changes: 129 additions & 118 deletions .github/workflows/lava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,122 +187,123 @@ jobs:
name: Protocol E2E Logs
path: "testutil/e2e/protocolLogs/*"

test-sdk-e2e:
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

# Install Node.js
- name: Setup Node.js environment
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: Build
run: yarn build
working-directory: ./ecosystem/lava-sdk

- name: Install ts-node
run: npm install -g ts-node

- name: Install telescope dependencies
run: yarn; yarn e2e-setup
working-directory: ./ecosystem/lavajs

- name: Setup test environment
run: npm init --yes; npm install --save-dev @types/node

######################################################
### Run Lava SDK E2E Tests
######################################################
- name: Run Lava SDK E2E Tests -timeout 1200s
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test ./testutil/e2e/ -run ^TestLavaSDK -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out sdk-e2e-report.xml # 20mins
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (SDK E2E)
path: "*-report.xml"

- name: tail -n 300 Lavad Logs
if: always()
run: tail -n 300 testutil/e2e/sdkLogs/00_StartLava.log

- name: Stake Lava All Logs
if: always()
run: cat testutil/e2e/sdkLogs/01_stakeLava.log

- name: Stake Lava Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/sdkLogs/01_stakeLava_errors.log

- name: head -n 300 JSON Proxy Logs
if: always()
run: head -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log

- name: tail -n 300 JSON Proxy Logs
if: always()
run: tail -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log

- name: JSON Proxy Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/sdkLogs/02_jsonProxy_errors.log

- name: JSON Provider All Logs
if: always()
run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --exclude="*errors*"

- name: JSON Provider Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --include="*errors*"

- name: Lava Provider All Logs
if: always()
run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --exclude="*errors*"

- name: Lava Provider Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --include="*errors*"

- name: Badge Server All Logs
if: always()
run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --exclude="*errors*"

- name: Badge Server Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --include="*errors*"

- name: Lava SDK All Logs
if: always()
run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --exclude="*errors*"

- name: Lava SDK Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --include="*errors*"
# Temporarly disabled due to a bug in the signature.
# test-sdk-e2e:
# 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

# # Install Node.js
# - name: Setup Node.js environment
# 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: Build
# run: yarn build
# working-directory: ./ecosystem/lava-sdk

# - name: Install ts-node
# run: npm install -g ts-node

# - name: Install telescope dependencies
# run: yarn; yarn e2e-setup
# working-directory: ./ecosystem/lavajs

# - name: Setup test environment
# run: npm init --yes; npm install --save-dev @types/node

# ######################################################
# ### Run Lava SDK E2E Tests
# ######################################################
# - name: Run Lava SDK E2E Tests -timeout 1200s
# run: |
# go install github.com/jstemmer/go-junit-report/v2@latest
# go test ./testutil/e2e/ -run ^TestLavaSDK -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out sdk-e2e-report.xml # 20mins

# - name: Upload Test Results
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: Test Results (SDK E2E)
# path: "*-report.xml"

# - name: tail -n 300 Lavad Logs
# if: always()
# run: tail -n 300 testutil/e2e/sdkLogs/00_StartLava.log

# - name: Stake Lava All Logs
# if: always()
# run: cat testutil/e2e/sdkLogs/01_stakeLava.log

# - name: Stake Lava Error Only Logs
# if: always()
# continue-on-error: true
# run: cat testutil/e2e/sdkLogs/01_stakeLava_errors.log

# - name: head -n 300 JSON Proxy Logs
# if: always()
# run: head -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log

# - name: tail -n 300 JSON Proxy Logs
# if: always()
# run: tail -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log

# - name: JSON Proxy Error Only Logs
# if: always()
# continue-on-error: true
# run: cat testutil/e2e/sdkLogs/02_jsonProxy_errors.log

# - name: JSON Provider All Logs
# if: always()
# run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --exclude="*errors*"

# - name: JSON Provider Error Only Logs
# if: always()
# continue-on-error: true
# run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --include="*errors*"

# - name: Lava Provider All Logs
# if: always()
# run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --exclude="*errors*"

# - name: Lava Provider Error Only Logs
# if: always()
# continue-on-error: true
# run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --include="*errors*"

# - name: Badge Server All Logs
# if: always()
# run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --exclude="*errors*"

# - name: Badge Server Error Only Logs
# if: always()
# continue-on-error: true
# run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --include="*errors*"

# - name: Lava SDK All Logs
# if: always()
# run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --exclude="*errors*"

# - name: Lava SDK Error Only Logs
# 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/*"
# - name: Upload SDK E2E Logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: SDK E2E Logs
# path: "testutil/e2e/sdkLogs/*"

test-payment-e2e:
runs-on: ubuntu-latest
Expand All @@ -328,9 +329,9 @@ jobs:
name: Test Results (Payment E2E)
path: "*-report.xml"

- name: tail -n 300 Lavad Logs
- name: Lavad Logs
if: always()
run: tail -n 300 testutil/e2e/protocolLogs/00_StartLava.log
run: grep 'err\|lava_' testutil/e2e/protocolLogs/00_StartLava.log

- name: Stake Lava All Logs
if: always()
Expand Down Expand Up @@ -368,7 +369,14 @@ jobs:

report-tests-results:
runs-on: ubuntu-latest
needs: [test-consensus, test-protocol, test-protocol-e2e, test-sdk-e2e, test-payment-e2e]
needs:
[
test-consensus,
test-protocol,
test-protocol-e2e,
# test-sdk-e2e,
test-payment-e2e,
]
if: always()
steps:
- name: Download Artifacts
Expand Down Expand Up @@ -418,10 +426,13 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: cmd/${{ matrix.binary }}/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
GIT_VERSION="${{ steps.meta.outputs.version }}"
GIT_COMMIT="${{ github.sha }}"
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

build_and_package:
name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }}
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
contents: write

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
large-packages: false
docker-images: false
swap-storage: false
tool-cache: false

- name: Checkout code
uses: actions/checkout@v4
with:
Expand All @@ -31,19 +39,11 @@ jobs:
- name: Fetch all tags
run: |
git fetch --force --tags
- name: Configure Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum


- name: Run GoReleaser
id: releaser
uses: goreleaser/goreleaser-action@v5
uses: docker://goreleaser/goreleaser-cross:v1.22
with:
version: latest
args: release --clean --timeout 90m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -58,7 +58,7 @@ jobs:
env:
REGISTRY: ghcr.io
IMAGE_NAME: "lavanet/lava/${{ matrix.binary }}"
steps:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
Expand All @@ -85,7 +85,28 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: cmd/${{ matrix.binary }}/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
GIT_VERSION="${{ steps.meta.outputs.version }}"
GIT_COMMIT="${{ github.sha }}"
push: true
push: true
- name: Extract metadata (cosmovisor)
if: ${{ matrix.binary == 'lavad' }}
id: meta-cosmovisor
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cosmovisor
tags: |
type=raw,value=latest,enable=true
- name: Build and push
uses: docker/build-push-action@v5
if: ${{ matrix.binary == 'lavad' }}
with:
tags: ${{ steps.meta-cosmovisor.outputs.tags }}
labels: ${{ steps.meta-cosmovisor.outputs.labels }}
file: cmd/${{ matrix.binary }}/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
GIT_VERSION="${{ steps.meta-cosmovisor.outputs.version }}"
GIT_COMMIT="${{ github.sha }}"
push: true
Loading

0 comments on commit 2a33633

Please sign in to comment.