E2E Linux #1431
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 Linux | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Run tests against branch' | |
default: 'rc-latest' | |
tags: | |
description: 'Test tags (all, light, offchain...)' | |
default: 'all' | |
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 }} | |
BRANCH: ${{ github.event.inputs.branch || 'rc-latest' }} | |
TAGS: ${{ github.event.inputs.tags || 'all' }} | |
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: 💾 GH Restore Cache of node db | |
id: cache-node | |
uses: actions/cache@v3 | |
with: | |
path: test/e2e/state/node_db/preprod | |
key: node-db-e2e-linux-preprod | |
- name: Fetch preprod snapshot | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: | | |
mkdir state || true | |
cd state | |
mkdir node_db | |
cd node_db | |
mkdir preprod | |
cd preprod | |
curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ | |
| jq -r .[].file_name > snapshot.json | |
curl -o - \ | |
https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ | |
| lz4 -c -d - | tar -x -C . | |
mv db/* . | |
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | |
run: rake setup[preprod,$BRANCH] | |
- name: 🔍 Display versions | |
run: rake display_versions | |
- name: 🚀 Start node and wallet | |
run: rake start_node_and_wallet[preprod] | |
- name: ⏳ Wait until node is synced | |
run: rake wait_until_node_synced | |
- name: 🧪 Run all tests | |
run: rake spec SPEC_OPTS="-t $TAGS" | |
- name: 🏁 Stop node and wallet | |
run: rake stop_node_and_wallet[preprod] | |
- 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-e2e-linux-preprod | |
- name: 📎 Upload state | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: linux-state | |
path: | | |
test/e2e/state/logs | |
test/e2e/state/configs | |
test/e2e/state/wallet_db | |
- 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' |