From 1888b9c98a3cac30ace88812bfc7a02075f11044 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Thu, 21 Apr 2022 19:30:17 -0400 Subject: [PATCH] Final working Make --- .github/workflows/on-pr-automated.yaml | 55 ++++++++++++++++++++++++-- .github/workflows/on-pr-manual.yml | 7 ---- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/.github/workflows/on-pr-automated.yaml b/.github/workflows/on-pr-automated.yaml index 03ada3c..2f196de 100644 --- a/.github/workflows/on-pr-automated.yaml +++ b/.github/workflows/on-pr-automated.yaml @@ -1,6 +1,8 @@ name: Test Application -on: [pull_request] +on: + pull_request: + jobs: build: name: Run docker build @@ -11,13 +13,58 @@ jobs: run: make docker-build test: name: Run unit tests - env: - GOPATH: /tmp/go 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: ${{ github.event.inputs.tags }} + 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 + make test diff --git a/.github/workflows/on-pr-manual.yml b/.github/workflows/on-pr-manual.yml index 58e9146..26807cb 100644 --- a/.github/workflows/on-pr-manual.yml +++ b/.github/workflows/on-pr-manual.yml @@ -71,13 +71,6 @@ jobs: go install github.com/onsi/ginkgo/v2/ginkgo@latest which ginkgo - - name: Run the tests - run: | - cd ipld-ethcl-indexer - go vet ./... - go fmt ./... - $(which ginkgo) -r - - name: Run the tests using Make run: | cd ipld-ethcl-indexer