Skip to content

Commit

Permalink
pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IshayuR committed Nov 14, 2024
2 parents 61fef11 + 66bbc8f commit 3b28379
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
on:
push:
branches:
- main
- develop
paths:
- frontend/**

jobs:
react_test_and_lint:
name: Test and Lint React app
runs-on: self-hosted
steps:
- name: Checkout the files
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.3.1'

# Caching dependencies to speed up subsequent runs
- name: Restore cached dependencies
id: cache-restore
uses: actions/cache@v3
with:
path: ./frontend/node_modules
key: npm-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
npm-
- name: Install dependencies
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
cd frontend
npm ci --ignore-scripts
# Run tests if they are set up (assuming `npm test` is configured in package.json)
- name: Test with Jest
run: |
cd frontend
npm run test -- --watchAll=false
# Run ESLint for code quality
- name: Run ESLint
run: |
cd frontend
npm run lint
# Build the app to ensure there are no build errors
- name: Build the Vite app
run: |
cd frontend
npm run build
# Optional Docker build job if containerization is required
docker_build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout the files
uses: actions/checkout@v2

- name: Build Docker Image
run: |
docker build -t react-app:latest frontend/
- name: Push Docker Image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker tag react-app:latest your-docker-repo/react-app:latest
docker push your-docker-repo/react-app:latest

0 comments on commit 3b28379

Please sign in to comment.