2022-06-03 16:47:13 +00:00
|
|
|
name: Test the stack.
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
stack-orchestrator-ref:
|
|
|
|
required: false
|
|
|
|
type: string
|
2022-06-09 21:32:46 +00:00
|
|
|
ipld-eth-beacon-db-ref:
|
2022-06-03 16:47:13 +00:00
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
ssz-data-ref:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
secrets:
|
|
|
|
GHA_KEY:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
env:
|
2022-06-10 13:30:52 +00:00
|
|
|
stack-orchestrator-ref: ${{ inputs.stack-orchestrator-ref || '7fb664270a0ba09e2caa3095e8c91f3fdb5b38af' }}
|
2022-09-29 01:39:56 +00:00
|
|
|
ipld-eth-beacon-db-ref: ${{ inputs.ipld-eth-beacon-db-ref || '6b38fe9b18f7b19a803c626b742cafdccc1a2365' }}
|
2022-06-03 16:47:13 +00:00
|
|
|
ssz-data-ref: ${{ inputs.ssz-data-ref || 'main' }}
|
|
|
|
GOPATH: /tmp/go
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Run Docker Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-indexer"
|
2022-06-03 16:47:13 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.stack-orchestrator-ref }}
|
|
|
|
path: "./stack-orchestrator/"
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/stack-orchestrator
|
2022-06-03 16:47:13 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
ref: ${{ env.ipld-eth-beacon-db-ref }}
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/ipld-eth-beacon-db
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-db/"
|
2022-06-03 16:47:13 +00:00
|
|
|
ssh-key: ${{secrets.GHA_KEY}}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create config file
|
|
|
|
run: |
|
2022-06-09 21:32:46 +00:00
|
|
|
echo vulcanize_ipld_eth_beacon_db=$GITHUB_WORKSPACE/ipld-eth-beacon-db/ > ./config.sh
|
|
|
|
echo vulcanize_ipld_eth_beacon_indexer=$GITHUB_WORKSPACE/ipld-eth-beacon-indexer >> ./config.sh
|
2022-06-10 13:30:52 +00:00
|
|
|
echo eth_beacon_config_file=$GITHUB_WORKSPACE/ipld-eth-beacon-indexer/config/cicd/boot.ipld-eth-beacon-indexer.json >> ./config.sh
|
2022-06-15 15:49:30 +00:00
|
|
|
echo eth_beacon_capture_mode=boot >> ./config.sh
|
2022-12-06 20:55:14 +00:00
|
|
|
echo CAPTURE_MODE=boot >> config.sh
|
2022-06-03 16:47:13 +00:00
|
|
|
cat ./config.sh
|
|
|
|
|
|
|
|
- name: Run docker compose
|
|
|
|
run: |
|
|
|
|
docker-compose \
|
2022-06-09 21:32:46 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-db.yml" \
|
2022-06-03 16:47:13 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-lighthouse.yml" \
|
2022-06-09 21:32:46 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-indexer.yml" \
|
2022-06-03 16:47:13 +00:00
|
|
|
--env-file ./config.sh \
|
|
|
|
up -d --build
|
|
|
|
|
|
|
|
- name: Check to make sure HEALTH file is present
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-09-29 01:39:56 +00:00
|
|
|
until $(docker compose \
|
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-db.yml" \
|
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-indexer.yml" \
|
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-lighthouse.yml" \
|
|
|
|
--env-file ./config.sh cp ipld-eth-beacon-indexer:/root/HEALTH ./HEALTH) ; do sleep 10; done
|
2022-06-03 16:47:13 +00:00
|
|
|
cat ./HEALTH
|
2022-06-09 21:32:46 +00:00
|
|
|
if [[ "$(cat ./HEALTH)" -eq "0" ]]; then echo "Application boot successful" && (exit 0); else docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-indexer.yml" cp ipld-eth-beacon-indexer:/root/ipld-eth-beacon-indexer.log . && cat ipld-eth-beacon-indexer.log && (exit 1); fi
|
2022-06-03 16:47:13 +00:00
|
|
|
|
|
|
|
unit-test:
|
|
|
|
name: Run Unit Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
## IF you want to update the default branch for `pull_request runs, do it after the ||`
|
|
|
|
steps:
|
|
|
|
- name: Create GOPATH
|
|
|
|
run: mkdir -p /tmp/go
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-indexer"
|
2022-06-03 16:47:13 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.stack-orchestrator-ref }}
|
|
|
|
path: "./stack-orchestrator/"
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/stack-orchestrator
|
2022-06-03 16:47:13 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
ref: ${{ env.ipld-eth-beacon-db-ref }}
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/ipld-eth-beacon-db
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-db/"
|
2022-06-03 16:47:13 +00:00
|
|
|
ssh-key: ${{ secrets.GHA_KEY }}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.ssz-data-ref }}
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/ssz-data
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-indexer/pkg/beaconclient/ssz-data"
|
2022-06-03 16:47:13 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create config file
|
|
|
|
run: |
|
2022-06-09 21:32:46 +00:00
|
|
|
echo vulcanize_ipld_eth_beacon_db=$GITHUB_WORKSPACE/ipld-eth-beacon-db/ > ./config.sh
|
|
|
|
echo vulcanize_ipld_eth_beacon_indexer=$GITHUB_WORKSPACE/ipld-eth-beacon-indexer >> ./config.sh
|
2022-06-03 16:47:13 +00:00
|
|
|
cat ./config.sh
|
|
|
|
|
|
|
|
- name: Run docker compose
|
|
|
|
run: |
|
|
|
|
docker-compose \
|
2022-06-09 21:32:46 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-db.yml" \
|
2022-06-03 16:47:13 +00:00
|
|
|
--env-file ./config.sh \
|
|
|
|
up -d --build
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
go-version: ">=1.18.0"
|
2022-06-03 16:47:13 +00:00
|
|
|
check-latest: true
|
|
|
|
|
|
|
|
- name: Install packages
|
|
|
|
run: |
|
2022-12-06 21:12:48 +00:00
|
|
|
go install github.com/onsi/ginkgo/v2/ginkgo@2.1.4
|
2022-06-03 16:47:13 +00:00
|
|
|
which ginkgo
|
|
|
|
|
|
|
|
- name: Run the tests using Make
|
|
|
|
run: |
|
2022-06-09 21:32:46 +00:00
|
|
|
cd ipld-eth-beacon-indexer
|
2022-06-03 16:47:13 +00:00
|
|
|
make unit-test-ci
|
|
|
|
|
|
|
|
integration-test:
|
|
|
|
name: Run Integration Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Create GOPATH
|
|
|
|
run: mkdir -p /tmp/go
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-indexer"
|
2022-06-03 16:47:13 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.stack-orchestrator-ref }}
|
|
|
|
path: "./stack-orchestrator/"
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/stack-orchestrator
|
2022-06-03 16:47:13 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
ref: ${{ env.ipld-eth-beacon-db-ref }}
|
2022-12-20 20:05:13 +00:00
|
|
|
repository: cerc-io/ipld-eth-beacon-db
|
2022-06-09 21:32:46 +00:00
|
|
|
path: "./ipld-eth-beacon-db/"
|
2022-06-03 16:47:13 +00:00
|
|
|
ssh-key: ${{secrets.GHA_KEY}}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create config file
|
|
|
|
run: |
|
2022-06-09 21:32:46 +00:00
|
|
|
echo vulcanize_ipld_eth_beacon_db=$GITHUB_WORKSPACE/ipld-eth-beacon-db/ > ./config.sh
|
|
|
|
echo vulcanize_ipld_eth_beacon_indexer=$GITHUB_WORKSPACE/ipld-eth-beacon-indexer >> ./config.sh
|
2022-06-03 16:47:13 +00:00
|
|
|
cat ./config.sh
|
|
|
|
|
|
|
|
- name: Run docker compose
|
|
|
|
run: |
|
|
|
|
docker-compose \
|
2022-06-09 21:32:46 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-beacon-db.yml" \
|
2022-06-03 16:47:13 +00:00
|
|
|
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-lighthouse.yml" \
|
|
|
|
--env-file ./config.sh \
|
|
|
|
up -d --build
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
go-version: ">=1.18.0"
|
2022-06-03 16:47:13 +00:00
|
|
|
check-latest: true
|
|
|
|
|
|
|
|
- name: Install packages
|
|
|
|
run: |
|
|
|
|
go install github.com/onsi/ginkgo/v2/ginkgo@latest
|
|
|
|
which ginkgo
|
|
|
|
|
|
|
|
- name: Run the tests using Make
|
|
|
|
run: |
|
2022-06-09 21:32:46 +00:00
|
|
|
cd ipld-eth-beacon-indexer
|
2022-06-03 16:47:13 +00:00
|
|
|
make integration-test-ci
|
|
|
|
|
|
|
|
golangci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-06-09 21:32:46 +00:00
|
|
|
go-version: ">=1.18.0"
|
2022-06-03 16:47:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
|
|
|
args: --timeout 90s --disable deadcode,unused
|
|
|
|
# args: --timeout 90s --disable deadcode,
|