2022-04-22 12:28:01 +00:00
|
|
|
name: Test Application
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-04-22 16:27:54 +00:00
|
|
|
paths:
|
|
|
|
- "!**.md"
|
|
|
|
- ".gitignore"
|
|
|
|
- "!LICENSE"
|
|
|
|
- "!.github/workflows/**"
|
|
|
|
- ".github/workflows/on-pr-automated.yaml"
|
2022-04-22 12:28:01 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-04-22 16:27:54 +00:00
|
|
|
name: Run Docker Build
|
2022-04-22 12:28:01 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Run docker build
|
|
|
|
run: make docker-build
|
2022-04-22 16:27:54 +00:00
|
|
|
|
|
|
|
unit-test:
|
|
|
|
name: Run Unit Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
foundry-test-ref: feature/build-stack
|
|
|
|
ipld-eth-db-ref: main
|
|
|
|
GOPATH: /tmp/go
|
|
|
|
steps:
|
|
|
|
- name: Create GOPATH
|
|
|
|
run: mkdir -p /tmp/go
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: "./ipld-ethcl-indexer"
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.foundry-test-ref }}
|
|
|
|
path: "./foundry-test/"
|
|
|
|
repository: vulcanize/foundry-test
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.ipld-eth-db-ref }}
|
|
|
|
repository: vulcanize/ipld-eth-db
|
|
|
|
path: "./ipld-eth-db/"
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create config file
|
|
|
|
run: |
|
|
|
|
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ > ./config.sh
|
|
|
|
echo vulcanize_ipld_ethcl_indexer=$GITHUB_WORKSPACE/ipld-ethcl-indexer >> ./config.sh
|
|
|
|
cat ./config.sh
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ">=1.17.0"
|
|
|
|
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: |
|
|
|
|
cd ipld-ethcl-indexer
|
|
|
|
make unit-test-ci
|
|
|
|
|
|
|
|
integration-test:
|
|
|
|
name: Run Integration Tests
|
2022-04-22 12:28:01 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
foundry-test-ref: feature/build-stack
|
|
|
|
ipld-eth-db-ref: main
|
|
|
|
GOPATH: /tmp/go
|
|
|
|
steps:
|
|
|
|
- name: Create GOPATH
|
|
|
|
run: mkdir -p /tmp/go
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: "./ipld-ethcl-indexer"
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.foundry-test-ref }}
|
|
|
|
path: "./foundry-test/"
|
|
|
|
repository: vulcanize/foundry-test
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.ipld-eth-db-ref }}
|
|
|
|
repository: vulcanize/ipld-eth-db
|
|
|
|
path: "./ipld-eth-db/"
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create config file
|
|
|
|
run: |
|
|
|
|
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ > ./config.sh
|
|
|
|
echo vulcanize_ipld_ethcl_indexer=$GITHUB_WORKSPACE/ipld-ethcl-indexer >> ./config.sh
|
|
|
|
cat ./config.sh
|
|
|
|
|
|
|
|
- name: Run docker compose
|
|
|
|
run: |
|
|
|
|
docker-compose \
|
|
|
|
-f "$GITHUB_WORKSPACE/foundry-test/docker/local/docker-compose-db.yml" \
|
|
|
|
-f "$GITHUB_WORKSPACE/foundry-test/docker/latest/docker-compose-lighthouse.yml" \
|
|
|
|
--env-file ./config.sh \
|
|
|
|
up -d --build
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ">=1.17.0"
|
|
|
|
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: |
|
|
|
|
cd ipld-ethcl-indexer
|
2022-04-22 16:27:54 +00:00
|
|
|
make integration-test-ci
|
|
|
|
|
|
|
|
golangci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ">=1.17.0"
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
|
|
|
args: --disable errcheck
|