|
| 1 | +name: '0Chain System Tests (Remote)' |
| 2 | +run-name: 'Remote system tests [${{ github.ref_name }}]' |
| 3 | + |
| 4 | +concurrency: |
| 5 | + group: 'system-tests-remote-${{ github.ref }}-${{ github.event_name }}' |
| 6 | + cancel-in-progress: true |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + repo_snapshots_branch: |
| 12 | + description: 'Branch of repo-snapshots to derive images and branches from.' |
| 13 | + default: 'current-sprint' |
| 14 | + required: true |
| 15 | + existing_network: |
| 16 | + description: 'Existing network to run system tests against (required). Example: dev.0chain.net' |
| 17 | + required: true |
| 18 | + test_file_filter: |
| 19 | + description: 'Comma separated list of test files to run (eg. zwalletcli_send_and_balance_test.go). If supplied, the PR will NOT be notified of the test result' |
| 20 | + default: '' |
| 21 | + required: false |
| 22 | + run_smoke_tests: |
| 23 | + description: 'Only run smoke tests (subset of system tests for fast feedback)' |
| 24 | + default: 'false' |
| 25 | + required: false |
| 26 | + |
| 27 | +jobs: |
| 28 | + system-tests: |
| 29 | + name: 'System Tests (Remote)' |
| 30 | + runs-on: [tests-suite] |
| 31 | + timeout-minutes: 360 |
| 32 | + steps: |
| 33 | + - name: 'Get current PR' |
| 34 | + uses: jwalton/gh-find-current-pr@v1 |
| 35 | + id: findPr |
| 36 | + with: |
| 37 | + github-token: ${{ github.token }} |
| 38 | + |
| 39 | + - name: 'Set PR status as pending' |
| 40 | + uses: 0chain/actions/set-pr-status@master |
| 41 | + if: steps.findPr.outputs.number && github.event.inputs.test_file_filter == '' |
| 42 | + with: |
| 43 | + pr_number: ${{ steps.findPr.outputs.pr }} |
| 44 | + description: 'System tests running with provided network...' |
| 45 | + state: 'pending' |
| 46 | + repository: ${{ github.repository }} |
| 47 | + status_name: '0Chain System Tests (Remote)' |
| 48 | + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 49 | + github_token: ${{ github.token }} |
| 50 | + |
| 51 | + - name: 'Config: Run tests against provided 0Chain network' |
| 52 | + run: | |
| 53 | + echo "NETWORK_URL=$(echo ${{ github.event.inputs.existing_network }})" >> $GITHUB_ENV |
| 54 | + echo "TEST_FILE_FILTER=$(echo $(([ -z '${{github.event.inputs.test_file_filter}}' ] && echo '') || echo '${{github.event.inputs.test_file_filter}}'))" >> $GITHUB_ENV |
| 55 | + echo "CURRENT_BRANCH=$(echo $(([ -z '${{ github.head_ref }}' ] && echo ${GITHUB_REF#refs/*/}) || echo '${{ github.head_ref }}'))" >> $GITHUB_ENV |
| 56 | + echo "REPO_SNAPSHOTS_BRANCH=$(echo $(([ -z '${{github.event.inputs.repo_snapshots_branch}}' ] && echo '<CURRENT BRANCH WITH FALLBACK TO CURRENT_SPRINT>') || echo '${{github.event.inputs.repo_snapshots_branch}}'))" >> $GITHUB_ENV |
| 57 | + if [[ "${{github.event.inputs.run_smoke_tests}}" == 'true' ]]; then |
| 58 | + echo RUN_SMOKE_TESTS=true >> $GITHUB_ENV |
| 59 | + else |
| 60 | + echo RUN_SMOKE_TESTS=false >> $GITHUB_ENV |
| 61 | + fi |
| 62 | +
|
| 63 | + - name: 'Setup jq' |
| 64 | + uses: dcarbone/install-jq-action@v2.1.0 |
| 65 | + with: |
| 66 | + version: '1.7' |
| 67 | + force: 'false' |
| 68 | + |
| 69 | + - name: 'Run System tests (remote)' |
| 70 | + uses: 0chain/actions/run-system-tests/action-remote.yml@run-st-remote |
| 71 | + with: |
| 72 | + repo_snapshots_branch: ${{ env.REPO_SNAPSHOTS_BRANCH }} |
| 73 | + system_tests_branch: ${{ env.CURRENT_BRANCH }} |
| 74 | + network: ${{ env.NETWORK_URL }} |
| 75 | + svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} |
| 76 | + custom_go_sdk_version: 'v1.20.9' |
| 77 | + deploy_report_page: true |
| 78 | + archive_results: true |
| 79 | + run_flaky_tests: true |
| 80 | + run_api_system_tests: true |
| 81 | + run_cli_system_tests: true |
| 82 | + run_tenderly_tests: false |
| 83 | + run_tokenomics_system_tests: false |
| 84 | + test_file_filter: ${{ env.TEST_FILE_FILTER }} |
| 85 | + run_smoke_tests: ${{ env.RUN_SMOKE_TESTS }} |
| 86 | + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} |
| 87 | + S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} |
| 88 | + DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }} |
| 89 | + GDRIVE_ACCESS_TOKEN: ${{ secrets.GDRIVE_ACCESS_TOKEN }} |
| 90 | + linux_server_ipv4: ${{ secrets.LINUX_SERVER_IPV4 }} |
| 91 | + linux_server_username: ${{ secrets.LINUX_SERVER_USERNAME }} |
| 92 | + linux_server_password: ${{ secrets.LINUX_SERVER_PASSWORD }} |
| 93 | + linux_server_hostkey: ${{ secrets.LINUX_SERVER_HOSTKEY }} |
| 94 | + linux_server_remote_path: '~/actions/run-system-tests' |
| 95 | + |
| 96 | + - name: 'Set PR status as ${{ job.status }}' |
| 97 | + if: ${{ (success() || failure()) && steps.findPr.outputs.number && github.event.inputs.test_file_filter == '' }} |
| 98 | + uses: 0chain/actions/set-pr-status@master |
| 99 | + with: |
| 100 | + pr_number: ${{ steps.findPr.outputs.pr }} |
| 101 | + description: 'System tests with provided network ${{ job.status }}' |
| 102 | + state: ${{ job.status }} |
| 103 | + repository: ${{ github.repository }} |
| 104 | + status_name: '0Chain System Tests (Remote)' |
| 105 | + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 106 | + github_token: ${{ github.token }} |
0 commit comments