Skip to content

Commit

Permalink
Merge branch 'main' into CNS-remove-openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarom Swisa authored and Yarom Swisa committed Jul 31, 2023
2 parents 391cc76 + abf213e commit 609a38c
Show file tree
Hide file tree
Showing 1,213 changed files with 480,505 additions and 295,432 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build_badgegenerator-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build Badge Generator (Staging)

on:
push:
branches:
- main
workflow_dispatch: {}

permissions:
id-token: write
contents: read

jobs:
main:
environment: Configure CI/CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/184173984234/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider'
service_account: '[email protected]'

- name: 'Set up GCP CLI'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'GCP CLI Info'
run: |
gcloud info
gcloud auth list --filter=status:ACTIVE --format="value(account)"
- name: 'GCP set project'
run: |
gcloud config set project lavanet-staging
- name: 'Authenticate to Google Artifact'
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev
- name: Set up NOW environment variable
id: "env-now"
run: |
echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build, tag, and push docker image to GCP
env:
REGISTRY: "us-central1-docker.pkg.dev/lavanet-staging/growth-staging-us-central1/badgegenerator-staging"
IMAGE_TAG: ${{ github.sha }}
NOW: ${{ env.NOW }}
run: |
docker buildx build \
-t $REGISTRY:latest \
-t $REGISTRY:$IMAGE_TAG \
-t $REGISTRY:$IMAGE_TAG-$NOW \
--cache-from="type=local,src=/tmp/.buildx-cache" \
--cache-to="type=local,dest=/tmp/.buildx-cache-new" \
--push -f Dockerfile .
# Necessary if you don't want your cache to grow forever, until
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache || true
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
80 changes: 80 additions & 0 deletions .github/workflows/build_badgegenerator-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build Badge Generator

on:
push:
branches:
- main
workflow_dispatch: {}

permissions:
id-token: write
contents: read

jobs:
main:
environment: Configure CI/CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/813817494934/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider'
service_account: '[email protected]'

- name: 'Set up GCP CLI'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'GCP CLI Info'
run: |
gcloud info
gcloud auth list --filter=status:ACTIVE --format="value(account)"
- name: 'GCP set project'
run: |
gcloud config set project lavanet-testnet
- name: 'Authenticate to Google Artifact'
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev
- name: Set up NOW environment variable
id: "env-now"
run: |
echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build, tag, and push docker image to GCP
env:
REGISTRY: "us-central1-docker.pkg.dev/lavanet-testnet/growth-testnet-us-central1/badgegenerator-testnet"
IMAGE_TAG: ${{ github.sha }}
NOW: ${{ env.NOW }}
run: |
docker buildx build \
-t $REGISTRY:latest \
-t $REGISTRY:$IMAGE_TAG \
-t $REGISTRY:$IMAGE_TAG-$NOW \
--cache-from="type=local,src=/tmp/.buildx-cache" \
--cache-to="type=local,dest=/tmp/.buildx-cache-new" \
--push -f Dockerfile .
# Necessary if you don't want your cache to grow forever, until
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache || true
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
14 changes: 7 additions & 7 deletions .github/workflows/consensus_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ jobs:
### Run Consensus unitests
######################################################
- name: lava pairing unit Tests
run: go test ./x/pairing/ ./x/pairing/keeper ./x/pairing/types -v
run: go test ./x/pairing/ ./x/pairing/keeper ./x/pairing/types

- name: lava epochstorage unit Tests
run: go test ./x/epochstorage/ ./x/epochstorage/keeper ./x/epochstorage/types -v
run: go test ./x/epochstorage/ ./x/epochstorage/keeper ./x/epochstorage/types

- name: lava spec unit Tests
run: go test ./x/spec/ ./x/spec/keeper ./x/spec/types -v
run: go test ./x/spec/ ./x/spec/keeper ./x/spec/types

- name: lava conflict unit Tests
run: go test ./x/conflict/ ./x/conflict/keeper ./x/conflict/types -v
run: go test ./x/conflict/ ./x/conflict/keeper ./x/conflict/types

- name: lava plans unit Tests
run: go test ./x/plans/ ./x/plans/keeper ./x/plans/types -v
run: go test ./x/plans/ ./x/plans/keeper ./x/plans/types

- name: lava projects unit Tests
run: go test ./x/projects/... -v
run: go test ./x/projects/...

- name: lava subscription unit Tests
run: go test ./x/subscription/... -v
run: go test ./x/subscription/...
40 changes: 10 additions & 30 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,30 @@ jobs:

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

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

- name: JSON Consumer All Logs
if: always()
run: cat testutil/e2e/logs/04_jsonConsumer.log
run: grep "" testutil/e2e/logs/04_jsonConsumer* --exclude="*errors*"

- name: JSON Consumer Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/logs/04_jsonConsumer_errors.log
run: grep "" testutil/e2e/logs/04_jsonConsumer* --include="*errors*"

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

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

- name: Lava over Lava All Logs
if: always()
Expand All @@ -121,31 +121,11 @@ jobs:
continue-on-error: true
run: cat testutil/e2e/logs/07_lavaOverLava_errors.log

- name: Rest Provider All Logs
if: always()
run: grep "" testutil/e2e/logs/08_restProvider* --exclude="*errors*"

- name: Rest Provider Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/logs/08_restProvider* --include="*errors*"

- name: GRPC Provider All Logs
if: always()
run: grep "" testutil/e2e/logs/10_grpcProvider* --exclude="*errors*"

- name: GRPC Provider Error Only Logs
if: always()
continue-on-error: true
run: grep "" testutil/e2e/logs/10_grpcProvider* --include="*errors*"

- name: RPCConsumer Consumer All Logs
if: always()
run: cat testutil/e2e/logs/06_RPCConsumer.log
run: grep "" testutil/e2e/logs/06_RPCConsumer* --exclude="*errors*"

- name: RPCConsumer Consumer Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/logs/06_RPCConsumer_errors.log


run: grep "" testutil/e2e/logs/06_RPCConsumer* --include="*errors*"
29 changes: 29 additions & 0 deletions .github/workflows/lava_sdk_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lava SDK Tests

on: [pull_request]

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

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

- name: Install modules
run: yarn install
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
working-directory: ./ecosystem/lava-sdk
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
config: .golangci.yml
args: --print-issued-lines --config .golangci.yml -v
68 changes: 68 additions & 0 deletions .github/workflows/network-upgrades-tag-populate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 'Network upgrade - Populate tags'

on:
push:
tags:
- 'v*'

permissions: write-all

jobs:
upgrade:
name: 'Network upgrade - Populate tags'
runs-on: ubuntu-latest
environment: default
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Confirm tag is in main branch
id: tag_main
run: |
branches=$(git branch -r --contains tags/$GITHUB_REF_NAME)
for branch in $branches; do
if [[ $branch == "origin/main" ]]; then
echo "CHECK=true" >> $GITHUB_OUTPUT
fi
done
if [ "$onProtectedBranch" == false ]; then
echo "Tag not in main branch."
echo "CHECK=false" >> $GITHUB_OUTPUT
exit 1
fi
- name: Get last 10 tags
id: tags_populate
run: |
new_tags=$(git tag --sort=-version:refname | head -n 10)
new_tags_array=$(echo "$new_tags" | tr '\n' ' ')
echo "$new_tags_array"
echo "new_tags_array=$new_tags_array" >> $GITHUB_OUTPUT
- name: Checkout DevOps repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_TOKEN }}
repository: "lavanet/devops"

- name: Populate DevOps repository with new tags
run: |
new_tags_array=$(echo '${{ steps.tags_populate.outputs.new_tags_array }}' | tr '\n' ' ')
index=0
for version in $new_tags_array; do
echo "$version"
index="$index" version="$version" yq -i '.on.workflow_dispatch.inputs.tag_to_deploy.options[env(index)] = env(version)' .github/workflows/network-upgrades-receiver.yml
index=$((index+1))
done
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "(Bot) Update list of tags for CI/CD"
git push
6 changes: 1 addition & 5 deletions .github/workflows/protocol_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,4 @@ jobs:
### Run protocol unitests
######################################################
- name: Run Lava Protocol Tests
run: go test ./protocol/... -v
- name: Run Lava Chain Proxy Tests
run: go test ./relayer/chainproxy/ -v
- name: Run Relayer Metrics Unit Tests
run: go test ./relayer/metrics/ -v
run: go test ./protocol/...
Loading

0 comments on commit 609a38c

Please sign in to comment.