diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 8d0fd2d9d..e543e83f6 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -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: | @@ -39,39 +35,19 @@ 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 @@ -79,3 +55,39 @@ jobs: 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 diff --git a/playwright.config.ts b/playwright.config.ts index 71cbda8ce..21b624218 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -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', { @@ -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', {