diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77984f396..dab934dc6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -302,32 +302,10 @@ jobs: repository: TykTechnologies/tyk-analytics path: tyk-analytics token: ${{ secrets.ORG_GH_TOKEN }} - fetch-depth: 0 + fetch-depth: 1 + ref: ${{ env.BASE_REF }} + ref: $BASE_REF sparse-checkout: tests/api - - name: Choosing test code branch - working-directory: tyk-analytics/tests/api - run: | - if [[ ${{ github.event_name }} == "pull_request" ]]; then - PR_BRANCH=${{ github.event.pull_request.head.ref }} - TARGET_BRANCH=${{ github.event.pull_request.base.ref }} - echo "Looking for PR_BRANCH:$PR_BRANCH or TARGET_BRANCH:$TARGET_BRANCH..." - if git rev-parse --verify "origin/$PR_BRANCH" >/dev/null 2>&1; then - echo "PR branch $PR_BRANCH exists. Checking out..." - git checkout "$PR_BRANCH" - elif git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1; then - echo "Target branch $TARGET_BRANCH exists. Checking out..." - git checkout "$TARGET_BRANCH" - fi - fi - if [[ ${{ github.event_name }} == "push" ]]; then - PUSH_BRANCH=${{ github.ref_name }} - echo "Looking for PUSH_BRANCH:$PUSH_BRANCH..." - if git rev-parse --verify "origin/$PUSH_BRANCH" >/dev/null 2>&1; then - echo "Push branch $PUSH_BRANCH exists. Checking out..." - git checkout "$PUSH_BRANCH" - fi - fi - echo "Current commit: $(git rev-parse HEAD)" - uses: actions/setup-python@v5 with: cache: 'pip' @@ -356,6 +334,20 @@ jobs: USER_API_SECRET=${{ steps.env_up.outputs.USER_API_SECRET }} EOF env $(cat pytest.env | xargs) $pytest -m "${{ matrix.envfiles.apimarkers }}" + - name: Upload Playwright Test Report to S3 + if: failure() && steps.test_execution.outcome != 'success' && steps.env_up.outcome == 'success' + run: npm run upload_report_to_s3 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.UI_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.UI_AWS_SECRET_ACCESS_KEY }} + RUN_ID: 'tyk-analytics/${{ github.run_id }}' + working-directory: tyk-analytics/tests/ui + - name: Share S3 report link into summary + if: failure() && steps.test_execution.outcome != 'success' && steps.env_up.outcome == 'success' + run: | + echo "# :clipboard: S3 UI Test REPORT: ${{ matrix.envfiles.db }}-${{ matrix.envfiles.conf }}" >> $GITHUB_STEP_SUMMARY + echo "- Status: ${{ steps.test_execution.outcome == 'success' && ':white_check_mark:' || ':no_entry_sign:' }}" >> $GITHUB_STEP_SUMMARY + echo "- [Link to report](https://tyk-qa-reports.s3.eu-central-1.amazonaws.com/tyk-analytics/${{ github.run_id }}/index.html)" >> $GITHUB_STEP_SUMMARY - name: Generate metadata and upload test reports id: metadata_report if: always() && (steps.test_execution.conclusion != 'skipped')