Skip to content

picasso lp tokens migration (#3761) #907

picasso lp tokens migration (#3761)

picasso lp tokens migration (#3761) #907

name: "build-test-deploy-flaky"
on:
push:
branches:
- release-*
- main
pull_request:
merge_group:
types: [checks_requested]
permissions:
pull-requests: write
env:
NIX_VERSION: nix-2.13.2
NIXPKGS_CHANNEL: nixos-22.11
CACHIX_COMPRESSION_LEVEL: 16
CACHIX_JOBS: 8
CACHIX_COMPRESSION_METHOD: zstd
CACHIX_NAME: composable-community
DOCKER_REGISTRY_NAME: composablefi
# weird, next is implicit dependency of docker action
DOCKER_USER_OPTION: '$UID:$GID'
jobs:
test-subsquid:
name: test-subsquid [FLAKY]
strategy:
matrix:
arch: [x64-cute]
runs-on:
- self-hosted
- ${{ matrix.arch }}
concurrency:
group: ${{ github.workflow }}-test-subsquid-${{ matrix.arch }}-${{ github.event.pull_request.title }}
cancel-in-progress: true
steps:
- name: Set up Nix
uses: cachix/install-nix-action@daddc62a2e67d1decb56e028c9fa68344b9b7c2a # v18
with:
install_url: https://releases.nixos.org/nix/${{ env.NIX_VERSION }}/install
nix_path: nixpkgs=channel:${{ env.NIXPKGS_CHANNEL }}
extra_nix_config: |
sandbox = relaxed
narinfo-cache-negative-ttl = 0
system-features = kvm
- name: Set up Cachix
uses: cachix/cachix-action@298387a7aea14d6564aa5d6ead79272878339c8b # v12
with:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
name: ${{ env.CACHIX_NAME }}
- name: Add tools needed for non-nix steps
run: |
nix-channel --add https://nixos.org/channels/${{ env.NIXPKGS_CHANNEL }} nixpkgs
nix-channel --update
nix-env -iA nixpkgs.cachix nixpkgs.nodejs nixpkgs.git nixpkgs.git-lfs nixpkgs.tree nixpkgs.docker nixpkgs.coreutils nixpkgs.gnumake nixpkgs.python311 nixpkgs.gcc
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Setup jest
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
working-directory: subsquid
- name: Run tests
run: npm run test
working-directory: subsquid
package-subsquid-processor:
name: package-subsquid-processor [FLAKY]
needs:
- test-subsquid
strategy:
matrix:
arch: [x64-cute]
runs-on:
- self-hosted
- ${{ matrix.arch }}
concurrency:
group: ${{ github.workflow }}-package-subsquid-processor-${{ matrix.arch }}-${{ github.event.pull_request.title }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Log INFO commit sha
run: |
echo "GITHUB_SHA=${GITHUB_SHA} github.sha=${{ github.sha }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
tags: |
${{ env.DOCKER_REGISTRY_NAME }}/subsquid-processor:latest
${{ env.DOCKER_REGISTRY_NAME }}/subsquid-processor:${{ github.sha }}
context: subsquid
# do release flow
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
deploy-docs:
name: "deploy-docs"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-deploy-docs-${{ github.event.pull_request.title }}
cancel-in-progress: true
steps:
- name: Set up Nix
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
uses: cachix/install-nix-action@daddc62a2e67d1decb56e028c9fa68344b9b7c2a # v18
with:
install_url: https://releases.nixos.org/nix/${{ env.NIX_VERSION }}/install
nix_path: nixpkgs=channel:${{ env.NIXPKGS_CHANNEL }}
extra_nix_config: |
sandbox = relaxed
narinfo-cache-negative-ttl = 0
system-features = kvm
- name: Set up Cachix
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
uses: cachix/cachix-action@298387a7aea14d6564aa5d6ead79272878339c8b # v12
with:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
name: ${{ env.CACHIX_NAME }}
- name: Add tools needed for non-nix steps
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
run: |
nix-channel --add https://nixos.org/channels/${{ env.NIXPKGS_CHANNEL }} nixpkgs
nix-channel --update
nix-env -iA nixpkgs.cachix nixpkgs.nodejs nixpkgs.git nixpkgs.git-lfs nixpkgs.tree nixpkgs.docker
- uses: actions/checkout@v3
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
with:
lfs: true
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Build docs
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
uses: "./.github/templates/watch-exec"
with:
command: nix -- build .#docs-static
working-directory: ./docs
- name: Deploy docs
if: ${{ github.event_name == 'push' || (inputs.github_event_name == 'pull_request' && inputs.github_event_pull_request_head_repo_id == 383289760) }}
uses: FirebaseExtended/action-hosting-deploy@0f248036885ae672f78587669fa2923f0ef6cac2
with:
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DOCS_COMPOSABLE_FINANCE }}
projectId: composable-docs
entrypoint: docs/
# this must go same release flow as FE, not from main
channelId: ${{ github.event_name == 'push' && github.ref_name == 'main' && 'live' }}
deploy-pablo-preview:
name: "Deploy Pablo Preview [FLAKY]"
runs-on:
- self-hosted
- x64-cute
container:
image: node:latest
steps:
- run: |
apt-get update
apt-get install -y curl git
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install git-lfs
- uses: actions/checkout@v3
with:
lfs: true
ref: ${{ inputs.github_event_pull_request_head_sha }}
persist-credentials: false
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Import project setting
run: |
mkdir -p .vercel
echo '${{ secrets.PABLO_PROJ_JSON }}' >> .vercel/project.json
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: |
PREVIEW_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "preview-url=${PREVIEW_URL}" >> $GITHUB_OUTPUT
id: deploy
- name: Comment PR
uses: "./.github/templates/comment"
with:
message: |
### Pablo Preview URL
${{ steps.deploy.outputs.preview-url }}
comment_tag: 'Pablo Preview URL'
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy-picasso-preview:
name: "Deploy Picasso Preview [FLAKY]"
runs-on:
- self-hosted
- x64-cute
container:
image: node:latest
steps:
- run: |
apt-get update
apt-get install -y curl git
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install git-lfs
- uses: actions/checkout@v3
with:
lfs: true
ref: ${{ inputs.github_event_pull_request_head_sha }}
persist-credentials: false
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Import project setting
run: |
mkdir -p .vercel
echo '${{ secrets.PICASSO_PROJ_JSON }}' >> .vercel/project.json
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: |
PREVIEW_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "preview-url=${PREVIEW_URL}" >> $GITHUB_OUTPUT
id: deploy
- name: Comment PR
uses: "./.github/templates/comment"
with:
message: |
### Picasso Preview URL
${{ steps.deploy.outputs.preview-url }}
comment_tag: 'Picasso Preview URL'
github_token: ${{ secrets.GITHUB_TOKEN }}