-
Notifications
You must be signed in to change notification settings - Fork 85
60 lines (58 loc) · 2.32 KB
/
nightly-tests-call.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 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: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- 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/[email protected]
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