Skip to content

Integration Tests

Integration Tests #308

name: Integration Tests
on:
schedule:
- cron: '30 1 * * 1-5' # At 01:30 on every day-of-week from Monday through Friday.
workflow_dispatch:
jobs:
ui5-versions:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
ui5_versions: ${{ steps.output-ui5-versions.outputs.ui5_versions }}
steps:
- name: Read UI5 versions from cache
uses: actions/cache/restore@v4
with:
path: |
tests/integration/adaptation-editor/versions.json
key: ui5-versions
restore-keys: ui5-versions-
- name: Output UI5 versions
id: output-ui5-versions
run: |
cat tests/integration/adaptation-editor/versions.json
echo "ui5_versions=$(cat tests/integration/adaptation-editor/versions.json)" >> $GITHUB_OUTPUT
playwright-tests:
# if: github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
ui5-version: ${{ fromJson(needs.ui5-versions.outputs.ui5_versions) }}
runs-on: ubuntu-latest
needs: ui5-versions
timeout-minutes: 30
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ubuntu-latest-build-${{ env.cache-name }}-20.x-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
ubuntu-latest-build-build-${{ env.cache-name }}-20.x-
- name: Use Node.js 20.x
uses: actions/setup-node@v6
with:
node-version: 20.x
- name: Install pnpm modules
run: pnpm install
- name: Run build
run: pnpm run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Cache playwright browsers
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: playwright-browsers-os-ubuntu-latest-node-version-20.x
- name: Install playwright chrome browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install chrome
- name: Read UI5 versions from cache
uses: actions/cache/restore@v4
with:
path: |
tests/integration/adaptation-editor/versions.json
key: ui5-versions-
restore-keys: ui5-versions
- name: Run playwright tests
run: cd tests/integration/adaptation-editor && pnpm exec playwright test --project=${{ matrix.ui5-version }} --reporter=blob
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.ui5-version }}
path: tests/integration/adaptation-editor/blob-report
retention-days: 1
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() }}
needs: [playwright-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ubuntu-latest-build-${{ env.cache-name }}-20.x-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
ubuntu-latest-build-build-${{ env.cache-name }}-20.x-
- name: Use Node.js 20.x
uses: actions/setup-node@v6
with:
node-version: 20.x
- name: Install pnpm modules
run: pnpm install
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: tests/integration/adaptation-editor/all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: cd tests/integration/adaptation-editor && npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ github.run_attempt }}
path: tests/integration/adaptation-editor/playwright-report
retention-days: 15