Skip to content

Commit

Permalink
ci: split e2e into separate job (siemens#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
spike-rabbit authored and grantwforsythe committed Feb 2, 2025
1 parent 7fc5e35 commit 9327d96
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 54 deletions.
86 changes: 49 additions & 37 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@ jobs:
with:
node-version: lts/iron

# We cannot use built-in LFS functionality due to the missing support of custom LFS endpoints.
# See: https://github.com/actions/checkout/issues/365
- name: Pull Repository with LFS
run: git lfs pull

- name: Install
uses: bahmutov/npm-install@v1
run: npm ci

- name: Build and package library
run: |
npm run package --if-present
env:
CI: true
run: npm run package

- name: Format
run: |
npm run format:check --if-present
env:
CI: true
run: npm run format:check

- name: Lint
run: |
Expand All @@ -39,43 +35,59 @@ jobs:
CI: true

- name: Build
run: |
npm run build --if-present
env:
CI: true
run: npm run build

- name: Test
run: |
npm run ci --if-present
env:
CI: true

- name: E2E
uses: addnab/docker-run-action@v3
with:
image: mcr.microsoft.com/playwright:v1.46.0-jammy
options: --ipc=host -v ${{ github.workspace }}:/workspace -w /workspace
run: |
npm run e2e --if-present
env:
CI: true

- name: Upload E2E Results
if: always()
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: e2e-results
path: playwright/results
name: build
path: dist/ngx-datatable

- name: Test
run: npm run ci

- name: Build Docs
run: |
npm run build-docs --if-present
env:
CI: true
run: npm run build-docs

- name: Deploy Docs
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: dist/ngx-datatable
if: ${{ github.ref == 'refs/heads/master' }}

e2e:
runs-on: ubuntu-latest
needs: build
container: mcr.microsoft.com/playwright:v1.46.0-jammy
steps:
# The LFS situation is even worse here. As we are in another container, we need to install LFS manually.
- name: Install LFS
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt install git-lfs
- name: Checkout
uses: actions/checkout@v4

- name: Pull Repository with LFS
run: git lfs pull

- name: Download build
uses: actions/download-artifact@v4
with:
name: build
path: dist/ngx-datatable

- name: Install
run: npm ci

- name: E2E
run: npm run e2e

- name: Upload E2E Results
uses: actions/upload-artifact@v4
with:
name: e2e-results
path: playwright/results
18 changes: 1 addition & 17 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,13 @@ export default defineConfig({
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: isCI
? [
['github'],
[
'html',
{
open: 'on-failure',
outputFolder: './playwright/results/preview'
}
],
[
'junit',
{
outputFile: `./playwright/results/reports/report-e2e.xml`,
includeProjectInTestName: true
}
],
[
'./playwright/reporters/playwright-axe-reporter.ts',
{
Expand All @@ -89,15 +82,6 @@ export default defineConfig({
outputFolder: './playwright/results/preview'
}
],
[
'junit',
{
outputFile: `./playwright/results/reports/report-${
isA11y && isVrt ? 'e2e' : isA11y ? 'a11y' : 'vrt'
}.xml`,
includeProjectInTestName: true
}
],
[
'./playwright/reporters/playwright-axe-reporter.ts',
{
Expand Down

0 comments on commit 9327d96

Please sign in to comment.