Extensions Compatibility Tests #7
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: Extensions Compatibility Tests | |
on: | |
schedule: | |
- cron: "0 0 * * *" # runs at midnight every day | |
env: | |
TEST_USERNAME: admin | |
TEST_PASSWORD: password | |
CATTLE_BOOTSTRAP_PASSWORD: password | |
TEST_BASE_URL: https://127.0.0.1:8005 | |
API: https://127.0.0.1 | |
TEST_PROJECT_ID: rancher-dashboard | |
CYPRESS_API_URL: http://139.59.134.103:1234/ | |
TEST_RUN_ID: ${{github.run_number}}-${{github.run_attempt}}-extensions-compatibility-tests | |
jobs: | |
e2e-test-extensions-compatibility: | |
strategy: | |
fail-fast: false | |
matrix: | |
role: [ | |
{ username: 'admin', tag: '@adminUser' } | |
] | |
features: [ | |
['@elemental', 'elemental'] | |
] | |
rancherEnv: [ | |
['2.10', 'v2.9-head'], | |
# ['2.9', 'v2.9-head'] | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup env | |
uses: ./.github/actions/setup | |
# this is where docker is set up with the enviroment | |
- name: Run Rancher system ${{ matrix.rancherEnv[0] }} - image:${{ matrix.rancherEnv[1] }} | |
run: export RANCHER_VERSION_E2E=${{ matrix.rancherEnv[1] }} && yarn e2e:docker | |
## this is just setting up rancher and user | |
- name: Setup Rancher and user | |
run: | | |
yarn e2e:prod | |
env: | |
GREP_TAGS: ${{ matrix.role.tag }}Setup+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}Setup+${{ matrix.features[0] }} --@jenkins | |
TEST_USERNAME: ${{ matrix.role.username }} | |
TEST_ONLY: setup | |
# This is the actual triggering of the e2e test specs | |
- name: Run user tests | |
run: | | |
export SPEC_FILE="cypress/e2e/tests/extensions/${{ matrix.features[1] }}/${{ matrix.features[1] }}.spec.ts" && yarn e2e:prod | |
env: | |
TEST_SKIP: setup | |
GREP_TAGS: ${{ matrix.role.tag }}+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}+${{ matrix.features[0] }} --@jenkins | |
TEST_USERNAME: ${{ matrix.role.username }} | |
# Upload to sorry cypress in case of failure | |
- name: Upload screenshots | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{github.run_number}}-${{github.run_attempt}}-extensions-compatibility-tests-screenshots-${{ matrix.role.tag }}+${{ matrix.features[0] }} | |
path: cypress/screenshots | |
# Slack message with outcome - success | |
- name: Slack message in workflow success | |
env: | |
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: success() | |
shell: bash | |
run: | | |
curl -X POST \ | |
-H "Content-type: application/json; charset=utf-8" \ | |
--data '{"name": "${{ matrix.rancherEnv[0] }} - image:${{ matrix.rancherEnv[1] }} - ${{ matrix.features[1] }}", "status": "Workflow succedded! ✅", "workflow_run": ${{ github.run_id }} }' \ | |
$SLACK_URL | |
# Slack message with outcome - failure | |
- name: Slack message in workflow failure | |
env: | |
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: failure() | |
shell: bash | |
run: | | |
curl -X POST \ | |
-H "Content-type: application/json; charset=utf-8" \ | |
--data '{"name": "${{ matrix.rancherEnv[0] }} - image:${{ matrix.rancherEnv[1] }} - ${{ matrix.features[1] }}", "status": "Workflow failed! 🆘", "workflow_run": ${{ github.run_id }} }' \ | |
$SLACK_URL |