E2E Docker #1304
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 6 * * *" | |
workflow_dispatch: | |
inputs: | |
nodeTag: | |
description: 'Node docker-image tag to use' | |
required: true | |
default: '8.9.1' | |
walletTag: | |
description: 'Wallet docker-image tag to use' | |
required: true | |
default: 'rc-latest' | |
tags: | |
description: 'Test tags (all, light, offchain...)' | |
default: 'all' | |
branch: | |
description: 'Clone E2E tests from branch' | |
default: 'rc-latest' | |
defaults: | |
run: | |
working-directory: ./test/e2e | |
jobs: | |
test: | |
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 || 'rc-latest' }} | |
NODE: ${{ github.event.inputs.nodeTag || '8.9.1' }} | |
TESTS_E2E_TOKEN_METADATA: https://metadata.world.dev.cardano.org/ | |
TAGS: ${{ github.event.inputs.tags || 'all' }} | |
E2E_DOCKER_RUN: 1 | |
steps: | |
- name: Checkout the rc-latest tag | |
uses: actions/checkout@v4.1.1 | |
with: | |
ref: ${{ github.event.inputs.branch || 'rc-latest' }} | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
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[preprod,${{ env.WALLET}}] | |
- name: 💾 Cache node db | |
id: cache-node | |
uses: actions/cache@v3 | |
with: | |
path: test/e2e/state/node_db/preprod | |
key: node-db-docker-linux-preprod | |
- name: Fetch preprod snapshot | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: | | |
../../scripts/gh/fetch-preprod-snapshot.sh | |
- name: 🚀 Start node and wallet | |
run: | | |
echo "Wallet image tag: ${{ env.WALLET }}" | |
echo "Node image tag: ${{ env.NODE }}" | |
echo "Metadata server: ${{ env.TESTS_E2E_TOKEN_METADATA }}" | |
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 | |
run: | | |
docker run --rm cardanofoundation/cardano-wallet:$WALLET version | |
docker run --rm ghcr.io/intersectmbo/cardano-node:${{ env.NODE }} 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: linux-docker-logs | |
path: test/e2e/state/logs | |
- name: Stop docker-compose | |
run: NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down | |
- name: 💾 GH Save Cache of node db | |
if: always() | |
uses: actions/cache/save@v3 | |
with: | |
path: test/e2e/state/node_db/preprod | |
key: node-db-docker-linux-preprod | |
- 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: | | |
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
SLACK_COLOR: '#FF0000' | |
- name: Slack Notification on success | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_ICON_EMOJI: ':rocket:' | |
SLACK_USERNAME: 'GitHub Action' | |
SLACK_MESSAGE: | | |
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
SLACK_COLOR: '#00FF00' |