refactor: fixing test and other small changes #128
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: Javascript linting | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
node-version: 18 | |
concurrency: | |
group: Lint js ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
name: Lint vue and js files | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
# Yarn | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- name: Cache yarn files | |
uses: actions/cache@v3 | |
with: | |
path: .yarn/cache | |
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }} | |
${{ runner.os }}-yarn-v2- | |
- name: Install yarn dependencies | |
run: yarn install --immutable | |
- name: Run eslint | |
run: yarn run lint --fix | |
- name: Run prettier | |
run: yarn run format | |
- name: Check if there is any file update needed | |
run: | | |
status=$(git status --porcelain) | |
if [ -n "$status" ]; then | |
echo -e "Waiting modifications:\n$status" | |
echo "::error::Eslint and prettier found fixes. Please run 'yarn run lint' and 'yarn run format' prior to your next commit." | |
exit -1 | |
fi |