feat(blobstorage): covering tests for BlockMetaRepo, BlobHashRepo and… #146
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
name: Blobstorage | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "packages/blobstorage/**" | |
pull_request: | |
paths: | |
- "packages/blobstorage/**" | |
jobs: | |
test: | |
runs-on: [taiko-runner] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21.0" | |
- name: blobstorage - Unit Tests | |
working-directory: ./packages/blobstorage | |
run: go test `go list ./... | grep -v ./bindings | grep -v ./mock | grep -v ./cmd` -coverprofile=coverage.txt -covermode=atomic | |
- name: blobstorage - Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ./packages/blobstorage/coverage.txt | |
flags: blobstorage | |
push-docker-image: | |
# only push docker image on PR merge to main | |
if: ${{ github.event }} == 'push' | |
name: Build and push docker image | |
runs-on: [taiko-runner] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Login to GAR | |
uses: docker/login-action@v3 | |
with: | |
registry: us-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
us-docker.pkg.dev/evmchain/images/blobstorage | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=sha | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
push: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
PACKAGE=blobstorage |