[UXE-5924] chore: implements lint workflow #10
Workflow file for this run
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
name: Run Linters | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: | |
- dev | |
env: | |
HUSKY: 0 | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
container: | |
image: node:18-alpine3.18 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install SO deps | |
run: apk add --no-cache curl bash git | |
- name: Clone repository | |
run: | | |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . | |
git config --global --add safe.directory $(pwd) | |
- uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install packages | |
run: yarn ci | |
- name: Checking build integrity | |
run: | | |
echo "checking build integrity" | |
yarn build | |
rm -rf dist | |
rm -rf coverage | |
- name: Run eslint | |
run: yarn lint | |
- name: Run format | |
run: yarn format | |
- name: Check for uncommitted changes | |
run: | | |
if [[ -n $(git status --porcelain) ]]; then | |
echo " ❌ The code is not properly formatted. Run yarn format locally and commit the changes before submitting the PR." | |
exit 1 | |
fi |