Skip to content

CI: Update actions to v4 (#28858) #72

CI: Update actions to v4 (#28858)

CI: Update actions to v4 (#28858) #72

name: TestCafe tests
concurrency:
group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
cancel-in-progress: true
on:
pull_request:
push:
branches: [22_1]
jobs:
build:
name: build
strategy:
fail-fast: false
runs-on: devextreme-shr2
timeout-minutes: 15
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Restore npm cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
- name: Run npm install
run: npm install --no-audit --no-fund
- name: Build
run: npm run build:testcafe
- name: Zip artifacts
run: |
7z a -tzip -mx3 -mmt2 artifacts.zip artifacts scss/bundles testing/tests/Renovation/widgets.json
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: devextreme-artifacts
path: artifacts.zip
retention-days: 1
testcafe:
name: ${{ matrix.ARGS.name }}
needs: [build]
strategy:
fail-fast: false
matrix:
ARGS: [
{ componentFolder: "treeList", name: "treeList", concurrency: 1 },
{ componentFolder: "dataGrid", name: "dataGrid (1/2)", indices: "1/2" },
{ componentFolder: "dataGrid", name: "dataGrid (2/2)", indices: "2/2" },
{ componentFolder: "pivotGrid", name: "pivotGrid", concurrency: 1 },
{ componentFolder: "pivotGrid", name: "pivotGrid - material", theme: 'material.blue.light', concurrency: 1 },
{ componentFolder: "scheduler", name: "scheduler (1/5)", indices: "1/5" },
{ componentFolder: "scheduler", name: "scheduler (2/5)", indices: "2/5" },
{ componentFolder: "scheduler", name: "scheduler (3/5)", indices: "3/5" },
{ componentFolder: "scheduler", name: "scheduler (4/5)", indices: "4/5" },
{ componentFolder: "scheduler", name: "scheduler (5/5)", indices: "5/5" },
{ componentFolder: "form", name: "form" },
{ componentFolder: "editors", name: "editors" },
{ componentFolder: "navigation", name: "navigation" },
{ componentFolder: "htmlEditor", name: "htmlEditor", concurrency: 1 },
{ componentFolder: "form", name: "form - material", theme: 'material.blue.light' },
{ componentFolder: "editors", name: "editors - material", theme: 'material.blue.light' },
{ componentFolder: "navigation", name: "navigation - material", theme: 'material.blue.light' },
{ componentFolder: "htmlEditor", name: "htmlEditor - material", theme: 'material.blue.light', concurrency: 1 },
{ componentFolder: "renovation", name: "renovation (jquery)", platform: "jquery" },
{ componentFolder: "renovation", name: "renovation (react)", platform: "react" },
]
runs-on: devextreme-shr2
timeout-minutes: 90
steps:
- name: Get sources
uses: actions/checkout@v4
- uses: ./.github/actions/pin-browsers
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Restore npm cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
- name: Run npm install
run: npm install --no-audit --no-fund
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: devextreme-artifacts
- name: Prepare localization
if: matrix.ARGS.componentFolder == 'renovation'
run: npx gulp localization
- name: Unpack artifacts
run: 7z x artifacts.zip -aoa
- name: Prepare renovation playground
if: matrix.ARGS.componentFolder == 'renovation'
run: |
pushd testing/renovation
npm install --no-audit --no-fund --legacy-peer-deps
popd
npm run build:react
npx gulp build-renovation-testing
- name: Run TestCafe tests
run: |
[ "${{ matrix.ARGS.theme }}" == "material.blue.light" ] && THEME="--theme ${{ matrix.ARGS.theme }}"
[ "${{ matrix.ARGS.indices }}" != "" ] && INDICES="--indices ${{ matrix.ARGS.indices }}"
[ "${{ matrix.ARGS.concurrency }}" != "" ] && CONCURRENCY="--concurrency ${{ matrix.ARGS.concurrency }}"
[ "${{ matrix.ARGS.platform }}" != "" ] && PLATFORM="--platform ${{ matrix.ARGS.platform }}"
export TESTCAFE_DASHBOARD_LAYOUT_TESTING_ENABLED=true
export TESTCAFE_DASHBOARD_DEVEXTREME_TOKEN=eyJwcm9qZWN0SWQiOiI2YzgwZWU2My0yM2VkLTRlZjMtOTkxYi03MDY3M2MyYjk1YTgiLCJ0b2tlblNlY3JldCI6Ik5TQ1FtamFqTmhkR2NQRE9xRHNuZk1pWVJCQnA1N1NKaFBPUmF5ME9lYkVXU3VaSDg4cE5zcEJLYnJ0V0prSnhFdnI3ZnYyRGttL2RubUJ1UWtiUFdFYkVVNHpQbCtJQ0tQaXYwbHlwSkdwNHZNZElobWZLc2ZDUmJoSGZ0aEl0ZHRLZ2VETWIvclg0UFVOR0VHRHJKL21tYjdvRC81dWpOck1NZjdZdXIyRkRjdXNwUUwwUEFJeG9TeUR5QnFldTFHOGlRd1lWNlBNK1VMeTNFWm0zN0luQVMyN0JTOUx3WXVYTURadGVrK1ArZzhSem9vdG1oUlpRQU9MQVFWVlI2V2l0blhuMUFVSHkwMkxNblZLelFycGxXS1dXcVQ2OGt1QUxxM0daeTNaRzBQd0VWRDJpV2hGT3EvRTBOZVV3S3VjMDB5V3lYQ1BtQnNlMU9UdHZydz09In0=
export TESTCAFE_DASHBOARD_DEVEXTREME_URL=https://devextreme.resolve.sh
export TESTCAFE_DASHBOARD_BUILD_ID=${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME"
echo "$all_args"
npm run test-testcafe -- $all_args
- name: Sanitize job name
if: ${{ failure() }}
run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV
- name: Copy compared screenshot artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: compared-screenshots-${{ env.JOB_NAME }}
path: ${{ github.workspace }}/testing/testcafe/artifacts/compared-screenshots/**/*
if-no-files-found: ignore
- name: Copy failed test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: failed-tests-${{ env.JOB_NAME }}
path: ${{ github.workspace }}/testing/testcafe/artifacts/failedtests/**/*
if-no-files-found: ignore
merge-artifacts:
runs-on: devextreme-shr2
needs: testcafe
if: ${{ failure() }}
steps:
- name: Merge screenshot artifacts
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: compared-screenshots
pattern: compared-screenshots-*
delete-merged: true
- name: Merge failed test artifacts
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: failed-tests
pattern: failed-tests-*
delete-merged: true
notify:
runs-on: devextreme-shr2
name: Send notifications
needs: [build, testcafe]
if: always() && contains(needs.*.result, 'failure')
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/send-teams-notification
with:
hook_url: ${{secrets.TEAMS_ALERT}}
run_id: ${{github.run_id}}
bearer_token: ${{secrets.GITHUB_TOKEN}}
specific_repo: DevExpress/DevExtreme
specific_branch: 22_1