- Dependency order. #12
Workflow file for this run
This file contains hidden or 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: scenario | |
| on: | |
| push: | |
| tags: | |
| - 'scenario*' | |
| env: | |
| TAG_NAME: ${{ github.ref_name }} | |
| RUNTYPE_READ_ONLY: readonly | |
| RUNTYPE_READ_WRITE: readwrite | |
| RUNTYPE_DEPLOY: deploy | |
| RUNTYPE_ALL: all | |
| jobs: | |
| scenario-testing: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: ${{ vars.DEFAULT_JOB_TIMEOUT_MIN == '' && 120 || vars.DEFAULT_JOB_TIMEOUT_MIN }} | |
| steps: | |
| - name: Install Package dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y jq | |
| - name: Check out code into the Go module directory | |
| uses: actions/[email protected] | |
| - name: Setup Python | |
| uses: actions/[email protected] | |
| with: | |
| cache: pip | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: | | |
| pip3 install -r cicd/requirements.txt | |
| - name: Ref Parse | |
| run: | | |
| _defaultRunType="${{ env.RUNTYPE_READ_ONLY }}" | |
| tag_obj="$(python3 cicd/python/tag_parse.py '${{ github.ref_name }}' --parse-scenario-tag)" | |
| echo "tag_obj: $tag_obj" | |
| runID="$(echo "${tag_obj}" | jq -r '.run_id')" | |
| runType="$(echo "${tag_obj}" | jq -r '.run_type')" | |
| repositoryShorthand="$(echo "${tag_obj}" | jq -r '.repository_shorthand')" | |
| artifactRepositoryFullName='stackql/stackql' | |
| if [ "$repositoryShorthand" = "devel" ]; then | |
| artifactRepositoryFullName='stackql/stackql-devel' | |
| fi | |
| if [ "$runType" = "" ]; then | |
| runType="$_defaultRunType" | |
| elif [ "$runType" != "${{ env.RUNTYPE_READ_ONLY }}" ] \ | |
| && [ "$runType" != "${{ env.RUNTYPE_READ_WRITE }}" ] \ | |
| && [ "$runType" != "${{ env.RUNTYPE_DEPLOY }}" ] \ | |
| && [ "$runType" != "${{ env.RUNTYPE_ALL }}" ] | |
| then | |
| echo "Invalid run type: $runType" | |
| exit 1 | |
| fi | |
| { | |
| echo "runID=$runID" | |
| echo "artifactRepositoryFullName=$artifactRepositoryFullName" | |
| echo "runType=$runType" | |
| } >> "${GITHUB_ENV}" | |
| - name: Download Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: stackql_linux_amd64 | |
| path: build | |
| github-token: ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }} | |
| repository: ${{ env.artifactRepositoryFullName }} | |
| run-id: ${{ env.runID }} | |
| - name: Stackql permissions | |
| run: | | |
| sudo chmod a+rwx build/stackql | |
| ls -al build/stackql | |
| { | |
| echo "$(pwd)/build" | |
| } >> "${GITHUB_PATH}" | |
| - name: Check Stackql Version | |
| run: | | |
| stackql --version | |
| - name: Persist secrets | |
| run: | | |
| echo "$GCP_RO_SECRET" > cicd/keys/testing/google-ro-credentials.json | |
| echo "$GCP_RW_SECRET" > cicd/keys/testing/google-rw-credentials.json | |
| shell: bash | |
| env: | |
| GCP_RO_SECRET: ${{ secrets.CI_SCENARIO_GCP_RO_SECRET }} | |
| GCP_RW_SECRET: ${{ secrets.CI_SCENARIO_GCP_RW_SECRET }} | |
| - name: Run Read Only Walkthrough Scenarios | |
| if: ${{ env.runType == env.RUNTYPE_READ_ONLY || env.runType == env.RUNTYPE_ALL }} | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.CI_SCENARIO_RO_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_SCENARIO_RO_AWS_SECRET_ACCESS_KEY }} | |
| run: | | |
| python3 test/python/markdown_testing/markdown_testing.py --test-root=docs/walkthroughs/readonly 2>&1 | tee cicd/log/markdown-readonly-testing-results.log | |
| - name: Run Read Write Walkthrough Scenarios | |
| if: ${{ env.runType == env.RUNTYPE_READ_WRITE || env.runType == env.RUNTYPE_ALL }} | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.CI_SCENARIO_RW_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_SCENARIO_RW_AWS_SECRET_ACCESS_KEY }} | |
| run: | | |
| python3 test/python/markdown_testing/markdown_testing.py --test-root=docs/walkthroughs/readwrite 2>&1 | tee cicd/log/markdown-readwrite-testing-results.log | |
| - name: Run Deploy Walkthrough Scenarios | |
| if: ${{ env.runType == env.RUNTYPE_DEPLOY || env.runType == env.RUNTYPE_ALL }} | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.CI_SCENARIO_RW_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_SCENARIO_RW_AWS_SECRET_ACCESS_KEY }} | |
| run: | | |
| python3 test/python/markdown_testing/markdown_testing.py --test-root=docs/walkthroughs/deploy 2>&1 | tee cicd/log/markdown-deploy-testing-results.log | |
| - name: Upload Test Results | |
| uses: actions/[email protected] | |
| with: | |
| name: scenario_test_results | |
| path: cicd/log/markdown-*.log | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| rm -rf cicd/keys/testing | |