1
+ name : Integration Tests
2
+
3
+ on :
4
+ workflow_dispatch : null
5
+ push :
6
+ branches :
7
+ - main
8
+ - dev
9
+
10
+ jobs :
11
+ integration-tests :
12
+ runs-on : ubuntu-latest
13
+ env :
14
+ EXIT_STATUS : 0
15
+ steps :
16
+ - name : Clone Repository
17
+ uses : actions/checkout@v4
18
+ with :
19
+ fetch-depth : 0
20
+ submodules : ' recursive'
21
+
22
+ - name : Setup Python
23
+ uses : actions/setup-python@v5
24
+ with :
25
+ python-version : ' 3.x'
26
+
27
+ - name : Install Python deps
28
+ run : pip install -U setuptools wheel boto3 certifi
29
+
30
+ - name : Install Python SDK
31
+ run : make dev-install
32
+ env :
33
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
+
35
+ - name : Run Integration tests
36
+ run : |
37
+ timestamp=$(date +'%Y%m%d%H%M')
38
+ report_filename="${timestamp}_sdk_test_report.xml"
39
+ status=0
40
+ if ! python3 -m pytest test/integration/${INTEGRATION_TEST_PATH} --disable-warnings --junitxml="${report_filename}"; then
41
+ echo "EXIT_STATUS=1" >> $GITHUB_ENV
42
+ fi
43
+ env :
44
+ LINODE_TOKEN : ${{ secrets.LINODE_TOKEN }}
45
+
46
+ - name : Add additional information to XML report
47
+ run : |
48
+ filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
49
+ python tod_scripts/add_to_xml_test_report.py \
50
+ --branch_name "${GITHUB_REF#refs/*/}" \
51
+ --gha_run_id "$GITHUB_RUN_ID" \
52
+ --gha_run_number "$GITHUB_RUN_NUMBER" \
53
+ --xmlfile "${filename}"
54
+
55
+ - name : Upload test results
56
+ run : |
57
+ report_filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
58
+ python3 tod_scripts/test_report_upload_script.py "${report_filename}"
59
+ env :
60
+ LINODE_CLI_OBJ_ACCESS_KEY : ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
61
+ LINODE_CLI_OBJ_SECRET_KEY : ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
62
+
63
+ - name : Test Execution Status Handler
64
+ run : |
65
+ if [[ "$EXIT_STATUS" != 0 ]]; then
66
+ echo "Test execution contains failure(s)"
67
+ exit $EXIT_STATUS
68
+ else
69
+ echo "Tests passed!"
70
+ fi
0 commit comments