fix: incorrect yaml #5
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: Papyrus-Nightly-Tests-Call | ||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
secrets: | ||
INTEGRATION_TESTNET_NODE_URL: | ||
required: true | ||
INTEGRATION_TESTNET_SENDER_PRIVATE_KEY: | ||
required: true | ||
SLACK_BOT_TOKEN: | ||
required: true | ||
SLACK_ALERT_CHANNEL: | ||
required: true | ||
jobs: | ||
GW-integration-test-call: | ||
runs-on: ${{ inputs.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/install_rust | ||
<<<<<<< HEAD | ||
- name: Set up Native Dependencies | ||
uses: ./.github/actions/setup-native-deps | ||
id: native-deps | ||
- uses: Swatinem/rust-cache@v2 | ||
======= | ||
>>>>>>> main | ||
- run: sudo apt update; sudo apt -y install libclang-dev | ||
# Install libclang-dev that is not a part of the ubuntu vm in github actions. | ||
if: runner.os == 'Linux' | ||
- name: Run gateway_integration_test. | ||
id: run_test | ||
# Workflow steps exit upon failure of a subcommand (running `set -e` implicitly before the | ||
# run). As we want to keep running this step after a test failure we can either start with | ||
# `set +e` to suppress all errors, or, as done below, append `|| retVal=$?` to the command | ||
# which makes it successful while storing the potential erroneous code. | ||
run: > | ||
retVal=0; | ||
INTEGRATION_TESTNET_NODE_URL=${{ secrets.INTEGRATION_TESTNET_NODE_URL }} | ||
SENDER_PRIVATE_KEY=${{ secrets.INTEGRATION_TESTNET_SENDER_PRIVATE_KEY }} | ||
cargo test --test gateway_integration_test -p papyrus_rpc test_gw_integration_testnet | ||
-- --ignored || retVal=$?; | ||
echo "retVal=$retVal" >> $GITHUB_OUTPUT; | ||
if [ $retVal -ne 0 ]; then | ||
echo "Integration test failed with exit code $retVal"; | ||
fi; | ||
- name: In case of a failure - post to a Slack channel. | ||
id: slack | ||
if: ${{ steps.run_test.outputs.retVal != 0 }} | ||
uses: slackapi/slack-github-action@v1.24.0 | ||
with: | ||
channel-id: ${{ secrets.SLACK_ALERT_CHANNEL }} | ||
slack-message: > | ||
gateway_integration_test failed with exit code: ${{ steps.run_test.outputs.retVal }}, | ||
see | ||
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}| | ||
logs>. | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
- name: Fail job in case of test failure. | ||
if: ${{ steps.run_test.outputs.retVal != 0 }} | ||
run: exit 1 |