Skip to content

Merge pull request #370 from Blobscan/feat/web/starknet-blobs-decoding #1390

Merge pull request #370 from Blobscan/feat/web/starknet-blobs-decoding

Merge pull request #370 from Blobscan/feat/web/starknet-blobs-decoding #1390

Workflow file for this run

name: CI
on:
pull_request:
branches: ["*", "!changeset-release/next"]
push:
branches: ["master", "next"]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
FORCE_COLOR: 3
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Lint
run: pnpm lint
typecheck:
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Typecheck
run: pnpm type-check
build:
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Build
run: pnpm build
test:
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
ports:
# Maps port 6379 on service container to the host
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Setup GCS emulator
uses: fsouza/[email protected]
with:
version: "1.37.2"
backend: memory
scheme: http
data: packages/test/src/fixtures/gcs
- name: Generate Prisma Client
run: pnpm db:generate
- name: Test migrations
run: pnpm prisma migrate deploy --schema packages/db/prisma/schema.prisma
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci?schema=public
- name: Test
run: pnpm coverage
env:
POSTGRES_STORAGE_ENABLED: true
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Blobscan/blobscan
release_docker:
if: github.ref_name == 'next' || github.ref_name == 'master'
runs-on: ubuntu-latest
needs:
- lint
- typecheck
- build
- test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: blossomlabs/blobscan
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref_name == 'next' }}
type=raw,value=stable,enable=${{ github.ref_name == 'master' }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Github ENV variables
shell: bash
run: |
echo "BUILD_TIMESTAMP=$(date '+%F %H:%M:%S')" >> $GITHUB_ENV
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
GIT_COMMIT=${{ env.GIT_COMMIT }}