Skip to content

Commit

Permalink
ci: adding new PR workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cskiwi committed Jun 20, 2024
1 parent 85669a9 commit b84aa21
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI v2

on:
pull_request:
merge_group:

# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

# - run: bunx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"

- run: bun install --no-cache

- run: bunx nx affected -t lint test build

- name: Run Playwright tests
run: bunx nx affected --parallel 1 -t e2e-ci
id: run-e2e-tests
if: ${{ vars.PR_E2E_TESTS }}

- name: e2e reports
# Always run if the e2e-tests input is true
if: ${{ vars.PR_E2E_TESTS && (steps.run-e2e-tests.outcome == 'success' || steps.run-e2e-tests.outcome == 'failure') }}
run: |
echo "Combine all the reports into a single report"
# check if the "blob-reports" root directory exists and if it does, remove it and recreate it
if [ -d "blob-reports" ]; then
rm -rf blob-reports
fi
# create the "blob-reports" root directory
mkdir blob-reports
# copy all the reports into the "blob-reports" root directory
cp apps/**/blob-report/*.zip ./blob-reports
# create nx report
bunx playwright merge-reports --reporter=html,github ./blob-reports
## for copy pasting in shell
# bunx playwright show-report
- name: stop agents
run: bunx nx-cloud complete-ci-run
if: always()

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit b84aa21

Please sign in to comment.