test: add ci workflow for substreams tests
This commit is contained in:
49
.github/actions/substreams-docker/action.yml
vendored
Normal file
49
.github/actions/substreams-docker/action.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Build Docker Images
|
||||
description: Build Docker images
|
||||
inputs:
|
||||
protocols:
|
||||
required: true
|
||||
description: Protocols to test
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Build db image
|
||||
run: |
|
||||
docker buildx build \
|
||||
--cache-from type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to type=local,dest=/tmp/.buildx-cache \
|
||||
-f protocol-testing/postgres.Dockerfile \
|
||||
-t protocol-testing-db:latest \
|
||||
--load .
|
||||
shell: bash
|
||||
|
||||
- name: Build test-runner image
|
||||
run: |
|
||||
docker buildx build \
|
||||
--cache-from type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to type=local,dest=/tmp/.buildx-cache \
|
||||
-f protocol-testing/run.Dockerfile \
|
||||
-t protocol-testing-test-runner:latest \
|
||||
--load .
|
||||
shell: bash
|
||||
|
||||
- name: Run protocol tests
|
||||
env:
|
||||
PROTOCOLS: ${{ inputs.protocols }}
|
||||
RPC_URL: ${{ env.RPC_URL }}
|
||||
SUBSTREAMS_API_TOKEN: ${{ env.SUBSTREAMS_API_TOKEN }}
|
||||
run: |
|
||||
docker compose up --abort-on-container-exit --exit-code-from test-runner
|
||||
shell: bash
|
||||
working-directory: protocol-testing
|
||||
Reference in New Issue
Block a user