Skip to content

Commit

Permalink
Update react.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
olawanlejoel committed Jul 28, 2023
1 parent 3640c4f commit 645c4b3
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/react.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,59 @@ name: ChatGPT Clone App CI

on:
push:
branches: ["main"]
branches: "main"
pull_request:
branches: ["main"]
branches: "main"

jobs:
eslint:
name: Check Syntax with ESLint
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }} to Check Lint
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint

- name: Install Dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

test:
tests:
name: Run Tests
needs: eslint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 18.x to run Test
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- run: npm run test

- name: Install Dependencies
run: npm ci

- name: Run Tests
run: npm run test

deploy:
needs: [eslint, test]
name: Re-Deploy Application
needs: [eslint, tests]
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 645c4b3

Please sign in to comment.