Skip to content

Commit

Permalink
Merge branch 'main' into test-add-new-compontent-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke authored Apr 17, 2024
2 parents 13f7efd + dd5c8c5 commit 908e6e6
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 3,698 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/get-playwright-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import packageJson from '../../package.json' assert { type: 'json' };

const getPlaywrightVersion = () => {
const version = packageJson.devDependencies['@playwright/test'];
if (!version) {
console.error('Playwright version is missing');
process.exit(1);
}

return version;
};
export default getPlaywrightVersion;
46 changes: 0 additions & 46 deletions .github/scripts/update-playwright.js

This file was deleted.

34 changes: 0 additions & 34 deletions .github/scripts/update-prs.js

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/01-get-playwright-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: 🎭 Get playwright version

on:
workflow_call:
outputs:
version:
description: "Current playwright version"
value: ${{ jobs.playwright-version.outputs.version }}

jobs:
playwright-version:
name: Get and save publish version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.result }}
steps:
- name: ⏬ Checkout repo
uses: actions/checkout@v4

- name: 🔄 Init Cache
uses: ./.github/actions/npm-cache

- name: 🪁 Get playwright version
uses: actions/github-script@v7
id: version
with:
result-encoding: string
script: |
const { default: getPlaywrightVersion } = await import('${{ github.workspace }}/.github/scripts/get-playwright-version.js');
return await getPlaywrightVersion();
- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/02-e2e-foundations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 🎭 Playwright E2E

on:
workflow_call:
inputs:
version:
required: true
type: string

permissions:
actions: write
Expand All @@ -12,7 +16,7 @@ jobs:
name: 🧪🎭 - foundations
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.42.1
image: mcr.microsoft.com/playwright:v${{ inputs.version }}
steps:
- name: ⏬ Checkout repo
uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/02-e2e-regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 🎭 Playwright E2E

on:
workflow_call:
inputs:
version:
required: true
type: string

permissions:
actions: write
Expand All @@ -12,7 +16,7 @@ jobs:
name: 🧪🎭 - Regenerate snapshots
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.42.1
image: mcr.microsoft.com/playwright:v${{ inputs.version }}
steps:
- name: ⏬ Checkout repo
uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/02-e2e-showcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 🎭 Playwright E2E

on:
workflow_call:
inputs:
version:
required: true
type: string

permissions:
actions: write
Expand All @@ -12,7 +16,7 @@ jobs:
name: 🧪🎭 - ${{ matrix.framework }}:${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.42.1
image: mcr.microsoft.com/playwright:v${{ inputs.version }}
strategy:
fail-fast: false
matrix:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/02-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 🎭 Playwright E2E

on:
workflow_call:
inputs:
version:
required: true
type: string

permissions:
actions: write
Expand All @@ -12,7 +16,7 @@ jobs:
name: 🧪🎭 - ${{ matrix.framework }}:${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.42.1
image: mcr.microsoft.com/playwright:v${{ inputs.version }}
strategy:
fail-fast: false
matrix:
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/99-update-playwright.yml

This file was deleted.

26 changes: 22 additions & 4 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
if: github.event.pull_request == null || github.event.pull_request.head.repo.owner.login == 'db-ui'
uses: ./.github/workflows/00-scan-secrets.yml

get-playwright-version:
uses: ./.github/workflows/01-get-playwright-version.yml
needs: [init]

lint:
uses: ./.github/workflows/01-lint.yml
needs: [init]
Expand All @@ -29,24 +33,38 @@ jobs:

test-components:
uses: ./.github/workflows/02-e2e.yml
needs: [build-packages]
needs: [build-packages, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

test-foundations:
uses: ./.github/workflows/02-e2e-foundations.yml
needs: [build-packages]
needs: [build-packages, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

build-showcases:
uses: ./.github/workflows/01-build-showcases.yml
needs: [build-packages]

test-showcases:
uses: ./.github/workflows/02-e2e-showcases.yml
needs: [build-showcases]
needs: [build-showcases, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

regenerate-snapshots:
if: always() && (needs.test-components.result == 'failure' || needs.test-foundations.result == 'failure' || needs.test-showcases.result == 'failure')
uses: ./.github/workflows/02-e2e-regenerate.yml
needs: [test-components, test-showcases, test-foundations]
with:
version: ${{ needs.get-playwright-version.outputs.version }}
needs:
[
test-components,
test-showcases,
test-foundations,
get-playwright-version
]

checks-done:
if: ${{ always() }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
dependabot:
uses: ./.github/workflows/99-auto-merge.yml

dependabot-playwright:
uses: ./.github/workflows/99-update-playwright.yml

codeql:
uses: ./.github/workflows/99-codeql-analysis.yml

Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
init:
uses: ./.github/workflows/00-init.yml

get-playwright-version:
uses: ./.github/workflows/01-get-playwright-version.yml
needs: [init]

get-publish-version:
uses: ./.github/workflows/01-get-publish-version.yml
needs: [init]
Expand All @@ -34,15 +38,21 @@ jobs:

test-components:
uses: ./.github/workflows/02-e2e.yml
needs: [build-packages]
needs: [build-packages, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

test-foundations:
uses: ./.github/workflows/02-e2e-foundations.yml
needs: [build-packages]
needs: [build-packages, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

test-showcases:
uses: ./.github/workflows/02-e2e-showcases.yml
needs: [build-showcases]
needs: [build-showcases, get-playwright-version]
with:
version: ${{ needs.get-playwright-version.outputs.version }}

checks-done:
runs-on: ubuntu-latest
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/update-prs.yml

This file was deleted.

Loading

0 comments on commit 908e6e6

Please sign in to comment.