Skip to content

Commit

Permalink
Cache node_modules in stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas committed Sep 27, 2023
1 parent 84db103 commit c04ba93
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,28 @@ jobs:
stylelint:
name: stylelint
runs-on: ubuntu-latest
container: node:14
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: opendata-assets/package-lock.json

- name: cache node_modules
uses: actions/cache@v3
id: cache-node_modules
with:
path: ./opendata-assets/node_modules
key: ${{ runner.os }}-build-node_v20-${{ hashFiles('opendata-assets/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-node_v20-
- name: install npm packages
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
run: npm ci
working-directory: ./opendata-assets

- name: Install Dependencies
run: |
cat <<EOT >> .npmrc
Expand All @@ -78,7 +97,7 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: run stylelint
run: $(npm bin)/stylelint "src/less"
run: npx stylelint "src/less" -f github
working-directory: ./opendata-assets

slack:
Expand Down

0 comments on commit c04ba93

Please sign in to comment.