Skip to content

Stage 4 – Coursework review and evaluation #15

Stage 4 – Coursework review and evaluation

Stage 4 – Coursework review and evaluation #15

Workflow file for this run

name: Frontend CI
on:
pull_request:
paths:
- 'react-frontend/**'
jobs:
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
id: cache-node-modules
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
- run: npm install
working-directory: react-frontend
lint:
runs-on: ubuntu-latest
needs: dependencies
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- run: npm run lint
working-directory: react-frontend
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- run: npm run build
working-directory: react-frontend
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: react-frontend/dist