Skip to content

Commit

Permalink
ci: update yml
Browse files Browse the repository at this point in the history
  • Loading branch information
qzeene committed Jul 15, 2023
1 parent 7613994 commit 7185cc2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 48 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

jobs:
lint:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -27,7 +26,7 @@ jobs:
- name: Validate commits with commitlint
run: npx commitlint --from ${{ inputs.commit-from }} --to ${{ inputs.commit-to }} --verbose

tests:
unit-tests:
runs-on: ubuntu-latest
needs: lint
env:
Expand All @@ -40,13 +39,21 @@ jobs:
- name: Install deps
run: npm ci
- name: Run unit tests
continue-on-error: true
run: npm run test
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run Playwright tests
continue-on-error: true
run: npm run e2e

e2e-tests:
runs-on: ubuntu-latest
needs: lint
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npx playwright install chromium --with-deps
- run: npm run e2e
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
46 changes: 6 additions & 40 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,10 @@ name: pull-request
on:
pull_request:
branches: [ "master" ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install deps
run: npm ci
- name: Eslint checks
run: npx eslint .
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

tests:
runs-on: ubuntu-latest
needs: lint
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install deps
run: npm ci
- name: Run unit tests
run: npm run test
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run Playwright tests
run: npm run e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
jobs:
lint-and-tests:
uses: ./.github/workflows/lint-and-test.yml
with:
commit-from: ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
commit-to: ${{ github.event.pull_request.head.sha }}
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ jobs:
needs:
- build-and-deploy
- get-issue-id
- write-result-comment
if: always() && needs.build-and-deploy.result != 'skipped'
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 7185cc2

Please sign in to comment.