-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cd991e
commit a18da38
Showing
1 changed file
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,60 @@ on: | |
[push] | ||
|
||
jobs: | ||
build_and_test: | ||
# Job for installing dependencies and linting code | ||
Lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Code linting | ||
run: npm run lint | ||
|
||
# Job for building and running tests | ||
End-to-end-Tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build the project | ||
run: npm run build | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
|
@@ -23,31 +69,53 @@ jobs: | |
GOOGLE_CLIENT_ID: ${{secrets.GOOGLE_CLIENT_ID}} | ||
GOOGLE_CLIENT_SECRET: ${{secrets.GOOGLE_CLIENT_SECRET}} | ||
with: | ||
build: npm run build | ||
start: npm start | ||
spec: | | ||
cypress/e2e/*.cy.ts | ||
build: npm run build | ||
start: npm start | ||
spec: | | ||
cypress/e2e/*.cy.ts | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Playwright tests | ||
run: npx playwright test | ||
|
||
- uses: actions/upload-artifact@v4 | ||
- name: Upload Playwright Report | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
||
- name: Code linting | ||
run: npm run lint | ||
# Job for running unit tests and uploading coverage report | ||
Unit-Tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run tests and collect coverage | ||
- name: Run unit tests | ||
run: npm run test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
token: ${{ secrets.CODECOV_TOKEN }} |