Skip to content

Commit

Permalink
Fix docker E2E
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Nov 29, 2023
1 parent f7f682f commit c05a99f
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions .github/workflows/e2e-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:

runs-on: ubuntu-latest

env:
TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }}
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }}
WALLET: ${{ github.event.inputs.walletTag || 'dev-master' }}
TESTS_E2E_TOKEN_METADATA: https://metadata.cardano-testnet.iohkdev.io/
TAGS: ${{ github.event.inputs.tags || 'all' }}
E2E_DOCKER_RUN: 1

steps:
- uses: actions/checkout@v3.2.0

Expand All @@ -55,7 +63,7 @@ jobs:
run: bundle install

- name: ⚙️ Setup (get latest bins and configs and decode fixtures)
run: rake setup[$NETWORK]
run: rake setup[preprod]

- name: 🕒 Get Date/Time
id: date-time
Expand All @@ -67,29 +75,25 @@ jobs:
id: cache
uses: actions/cache@v3
with:
path: test/e2e/state/node_db/${{ env.NETWORK }}
key: node-db-docker-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
restore-keys: |
node-db-docker-${{ env.NETWORK }}-
node-db-Linux-${{ env.NETWORK }}-
path: test/e2e/state/node_db/preprod
key: node-db-docker-preprod

- name: 💾 Cache wallet db
id: cache-wallet
uses: actions/cache@v3
with:
path: test/e2e/state/wallet_db/${{ env.NETWORK }}
key: wallet-db3-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
restore-keys: wallet-db3-docker-${{ env.NETWORK }}-
path: test/e2e/state/wallet_db/preprod
key: wallet-db3-${{ runner.os }}-preprod

- name: 🚀 Start node and wallet
run: |
echo "Wallet: $WALLET"
echo "Node: ${{steps.cardano-node-tag.outputs.NODE_TAG}}"

NODE=${{steps.cardano-node-tag.outputs.NODE_TAG}} \
NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK \
DATA=`pwd`/state/node_db/$NETWORK \
WALLET_DATA=`pwd`/state/wallet_db/$NETWORK \
NODE_CONFIG_PATH=`pwd`/state/configs/preprod \
DATA=`pwd`/state/node_db/preprod \
WALLET_DATA=`pwd`/state/wallet_db/preprod \
docker-compose -f docker-compose-test.yml up --detach

- name: 🔍 Display versions
Expand All @@ -115,13 +119,16 @@ jobs:
path: test/e2e/state/logs

- name: Stop docker-compose
run: NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK docker-compose -f docker-compose-test.yml down
env:
TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }}
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }}
NETWORK: ${{ github.event.inputs.network || 'preprod' }}
WALLET: ${{ github.event.inputs.walletTag || 'dev-master' }}
TESTS_E2E_TOKEN_METADATA: https://metadata.cardano-testnet.iohkdev.io/
NODE_DB_CACHE: ${{ github.event.inputs.node_db_cache || 'GH' }}
TAGS: ${{ github.event.inputs.tags || 'all' }}
E2E_DOCKER_RUN: 1
run: NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down

- name: Slack Notification on failure
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ICON_EMOJI: ':poop:'
SLACK_USERNAME: 'GitHub Action'
SLACK_MESSAGE: |
*GitHub Action: ${{ github.workflow }} failed!*
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_COLOR: '#FF0000'

0 comments on commit c05a99f

Please sign in to comment.