update labels/release (#45) #26
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 Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
commit_sha: | |
description: 'The hash value of the commit.' | |
required: true | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
if: ${{ inputs.commit_sha != '' }} | |
with: | |
ref: ${{ inputs.commit_sha }} | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
if: ${{ inputs.commit_sha == '' }} | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: update packages | |
run: sudo apt-get update -y | |
- name: setup python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: install or update Python build system | |
run: python3 -m pip install -U wheel setuptools certifi pip | |
- name: install test dependencies | |
run: make test-deps | |
- name: generate local SSH key | |
run: ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" | |
- name: Install Python deps | |
run: pip3 install requests wheel boto3 | |
- name: Install go-junit-report | |
run: go install github.com/jstemmer/go-junit-report/v2@latest | |
- name: run e2e test | |
run: | | |
if ! make e2e ; then | |
echo "EXIT_STATUS=1" >> $GITHUB_ENV | |
fi | |
env: | |
CLEANUP_TEST_LINODE_INSTANCE: true | |
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }} | |
- name: Copy report.xml from hack directory to root directory | |
run: | | |
cp hack/*_go_metadata_test_report.xml . | |
- name: Add additional information to XML report | |
run: | | |
filename=$(ls | grep -E '^[0-9]{12}_go_metadata_test_report\.xml$') | |
python tod_scripts/add_to_xml_test_report.py \ | |
--branch_name "${GITHUB_REF#refs/*/}" \ | |
--gha_run_id "$GITHUB_RUN_ID" \ | |
--gha_run_number "$GITHUB_RUN_NUMBER" \ | |
--xmlfile "${filename}" | |
- name: Upload test results | |
run: | | |
filename=$(ls | grep -E '^[0-9]{12}_go_metadata_test_report\.xml$') | |
python tod_scripts/test_report_upload_script.py "${filename}" | |
env: | |
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }} | |
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }} | |
- name: Test Execution Status Handler | |
run: | | |
if [[ "$EXIT_STATUS" != 0 ]]; then | |
echo "Test execution contains failure(s)" | |
exit $EXIT_STATUS | |
else | |
echo "Tests passed!" | |
fi |