diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c924d9f..66781305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,105 +1,66 @@ -name: Continuous Integration +# .github/workflows/ci.yml +name: CI on: push: - branches: [ "main", "dev" ] + branches: [main] pull_request: - branches: [ "main", "dev" ] + branches: [main] jobs: - lint-frontend: - name: Lint Frontend + frontend: + name: Frontend — Lint, Build, Test runs-on: ubuntu-latest defaults: run: - working-directory: ./frontend + working-directory: frontend steps: - - name: Checkout Repository + - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js + - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20.x" - cache: "npm" + node-version: '20' + cache: 'npm' cache-dependency-path: frontend/package-lock.json - - name: Install Dependencies + - name: Install dependencies run: npm ci - - name: Run ESLint - run: npm run lint + - name: Lint + run: npm run lint --if-present - lint-backend: - name: Lint Backend - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./backend - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20.x" - cache: "npm" - cache-dependency-path: backend/package-lock.json - - - name: Install Dependencies - run: npm ci + - name: Build + run: npm run build - - name: Run ESLint - run: npm run lint + - name: Test + run: npm test --if-present -- --watchAll=false --passWithNoTests - lint-admin: - name: Lint Admin + backend: + name: Backend — Install & Lint runs-on: ubuntu-latest defaults: run: - working-directory: ./admin + working-directory: backend steps: - - name: Checkout Repository + - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js + - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20.x" - cache: "npm" - cache-dependency-path: admin/package-lock.json + node-version: '20' + cache: 'npm' + cache-dependency-path: backend/package-lock.json - - name: Install Dependencies + - name: Install dependencies run: npm ci - - name: Run ESLint - run: npm run lint + - name: Lint + run: npm run lint --if-present - build-frontend: - name: Build Frontend - runs-on: ubuntu-latest - needs: lint-frontend - defaults: - run: - working-directory: ./frontend - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20.x" - cache: "npm" - cache-dependency-path: frontend/package-lock.json - - - name: Install Dependencies - run: npm ci - - - name: Build - run: npm run build + - name: Test + run: npm test --if-present -- --passWithNoTests \ No newline at end of file diff --git a/README.md b/README.md index 89878edb..ac56dc1f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Issues](https://img.shields.io/github/issues/Nsanjayboruds/RIVETO)](https://github.com/Nsanjayboruds/RIVETO/issues) [![Stars](https://img.shields.io/github/stars/Nsanjayboruds/RIVETO)](https://github.com/Nsanjayboruds/RIVETO/stargazers) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11234/badge)](https://www.bestpractices.dev/projects/11234) +[![CI](https://github.com/Nsanjayboruds/RIVETO/actions/workflows/ci.yml/badge.svg)](https://github.com/Nsanjayboruds/RIVETO/actions/workflows/ci.yml) --- ## 📑 Table of Contents