diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 52b9a06..89b89fa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,3 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: Lint on: @@ -15,15 +12,34 @@ jobs: strategy: matrix: - node-version: [16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [18.x] steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npx prettier -c "**/*.js" - - run: npx eslint . + cache: "npm" + + - name: Clean npm cache and remove node_modules + run: | + rm -rf node_modules package-lock.json + npm cache clean --force + + - name: Install dependencies + run: npm install + + - name: Verify package-lock.json + run: git diff --exit-code package-lock.json || echo "⚠️ package-lock.json changed, please update it." + + - name: Run npm ci + run: npm ci + + - name: Run Prettier + run: npx prettier -c "**/*.js" + + - name: Run ESLint + run: npx eslint .