E2E Docker #1089
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Docker | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
inputs: | |
nodeTag: | |
description: 'Node tag (docker)' | |
required: true | |
default: '8.1.1' | |
walletTag: | |
description: 'Wallet tag (docker)' | |
required: true | |
default: 'dev-master' | |
network: | |
description: 'Network' | |
required: true | |
default: 'preprod' | |
tags: | |
description: 'Test tags (all, light, offchain...)' | |
default: 'all' | |
defaults: | |
run: | |
working-directory: ./test/e2e | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3.2.0 | |
- name: Get supported node tag | |
run: | | |
export TAG=$(cat ../../README.md | grep -o '`master` branch | \[.*\]' | awk '{ print $4 }'| sed -e 's/\[//g;s/\]//g') | |
if [ -z "${{github.event.inputs.nodeTag}}" ]; then | |
echo "NODE_TAG=$TAG" >> $GITHUB_OUTPUT | |
echo "Using cardano-node tag from README.md = $TAG" | |
else | |
echo "NODE_TAG=${{github.event.inputs.nodeTag}}" >> $GITHUB_OUTPUT | |
echo "Using cardano-node tag from workflow trigger parameter = ${{github.event.inputs.nodeTag}}" | |
fi | |
id: cardano-node-tag | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1.127.0 | |
with: | |
ruby-version: 3.1.2 | |
bundler-cache: true | |
- name: Install dependencies | |
run: bundle install | |
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | |
run: rake setup[$NETWORK] | |
- name: 🕒 Get Date/Time | |
id: date-time | |
shell: bash | |
run: | | |
echo "value=$(rake datetime)" >> $GITHUB_OUTPUT | |
- name: 💾 Cache node db | |
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 }}- | |
- 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 }}- | |
- 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 \ | |
docker-compose -f docker-compose-test.yml up --detach | |
- name: 🔍 Display versions | |
run: | | |
docker run --rm cardanofoundation/cardano-wallet:$WALLET version | |
docker run --rm inputoutput/cardano-node:${{steps.cardano-node-tag.outputs.NODE_TAG}} cli version | |
- name: ⏳ Wait until node is synced | |
run: rake wait_until_node_synced | |
- name: 🧪 Run all tests | |
run: rake spec SPEC_OPTS="-t $TAGS" | |
- name: 📖 Get docker logs | |
if: always() | |
run: rake get_docker_logs | |
- name: 📎 Upload logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ runner.os }}-docker-logs | |
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 |