diff --git a/.github/workflows/release-relayer.yml b/.github/workflows/release-relayer.yml index 0fae3ff1ea..114c99ed10 100644 --- a/.github/workflows/release-relayer.yml +++ b/.github/workflows/release-relayer.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - release-v1.0.0 workflow_dispatch: env: diff --git a/.github/workflows/smoketest.yml b/.github/workflows/smoketest.yml new file mode 100644 index 0000000000..a8c92ab950 --- /dev/null +++ b/.github/workflows/smoketest.yml @@ -0,0 +1,80 @@ +name: bridge + +on: + push: + branches: + - main + - smoketests-on-snowbridge + workflow_dispatch: + schedule: + # Runs at 8:00 AM every day + - cron: '0 8 * * *' + +jobs: + smoketests: + runs-on: snowbridge-runner + env: + CARGO_INCREMENTAL: 0 + RUST_BACKTRACE: 1 + RUSTFLAGS: -C debuginfo=1 + outputs: + success: ${{ steps.run_e2e_stack.outcome == 'success' }} + steps: + - name: Set build directory environment variable + run: echo "OUTPUT_DIR=${GITHUB_WORKSPACE}/tmp" >> $GITHUB_ENV + - name: Set log directory environment variable + run: echo "LOG_DIR=${GITHUB_WORKSPACE}/log-tmp" >> $GITHUB_ENV + - name: Create directories + run: mkdir -p $OUTPUT_DIR && mkdir -p $LOG_DIR + - uses: actions/checkout@v2 + with: + repository: snowfork/snowbridge + ref: smoketests-on-snowbridge + path: snowbridge + - uses: actions/checkout@v2 + with: + repository: paritytech/polkadot-sdk + ref: release-crates-io-v1.7.0 + path: snowbridge/polkadot-sdk + - uses: arduino/setup-protoc@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/cache@v1 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - uses: cachix/install-nix-action@v22 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + - name: run E2E stack + id: run_e2e_stack + run: | + cd snowbridge + nix develop -c sh -c ' + ./scripts/init.sh && + cd web/packages/test && + (./scripts/start-services.sh > "${{ env.LOG_DIR }}/start-services.log" 2>&1 &) && + sleep 10 && + ./scripts/check-relayer.sh && + ./scripts/run-smoketests.sh' + continue-on-error: true + - name: Save start-services log file + uses: actions/upload-artifact@v3 + with: + name: start-services.log + path: "${{ env.LOG_DIR }}/start-services.log" + - name: Save beacon-relay log file + uses: actions/upload-artifact@v3 + with: + name: beacon-relay.log + path: "${{ env.OUTPUT_DIR }}/beacon-relay.log" + - run: ls + - name: check E2E test outcome + if: ${{ steps.run_e2e_stack.outcome != 'success' }} + run: | + echo "E2E tests failed" + exit 1