-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into CNS-remove-openapi
- Loading branch information
Showing
1,213 changed files
with
480,505 additions
and
295,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.