chore: Fix CI cache directory (#2492)

This commit is contained in:
Marc Rousavy 2024-01-31 20:48:10 +01:00 committed by GitHub
parent ea568855a7
commit e399df5d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 58 additions and 58 deletions

View File

@ -39,7 +39,7 @@ jobs:
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache
@ -83,7 +83,7 @@ jobs:
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache

View File

@ -30,7 +30,7 @@ jobs:
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache
@ -87,7 +87,7 @@ jobs:
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache

View File

@ -36,39 +36,39 @@ jobs:
run: run:
working-directory: ./package working-directory: ./package
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install reviewdog - name: Install reviewdog
uses: reviewdog/action-setup@v1 uses: reviewdog/action-setup@v1
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- name: Install node_modules - name: Install node_modules
run: yarn install --frozen-lockfile run: yarn install --frozen-lockfile
- name: Install node_modules (example/) - name: Install node_modules (example/)
run: yarn install --frozen-lockfile --cwd example run: yarn install --frozen-lockfile --cwd example
- name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m - name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
run: | run: |
yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
env: env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run TypeScript in example/ # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m - name: Run TypeScript in example/ # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
run: | run: |
cd example && yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee && cd .. cd example && yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee && cd ..
env: env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint: lint:
name: Lint JS (eslint, prettier) name: Lint JS (eslint, prettier)
@ -77,36 +77,36 @@ jobs:
run: run:
working-directory: ./package working-directory: ./package
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache - name: Restore node_modules from cache
uses: actions/cache@v4 uses: actions/cache@v4
id: yarn-cache id: yarn-cache
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- name: Install node_modules - name: Install node_modules
run: yarn install --frozen-lockfile run: yarn install --frozen-lockfile
- name: Install node_modules (example/) - name: Install node_modules (example/)
run: yarn install --frozen-lockfile --cwd example run: yarn install --frozen-lockfile --cwd example
- name: Run ESLint - name: Run ESLint
run: yarn lint -f @jamesacarr/github-actions run: yarn lint -f @jamesacarr/github-actions
- name: Run ESLint with auto-fix - name: Run ESLint with auto-fix
run: yarn lint --fix run: yarn lint --fix
- name: Run ESLint in example/ - name: Run ESLint in example/
run: cd example && yarn lint -f @jamesacarr/github-actions && cd .. run: cd example && yarn lint -f @jamesacarr/github-actions && cd ..
- name: Run ESLint in example/ with auto-fix - name: Run ESLint in example/ with auto-fix
run: cd example && yarn lint --fix && cd .. run: cd example && yarn lint --fix && cd ..
- name: Verify no files have changed after auto-fix - name: Verify no files have changed after auto-fix
run: git diff --exit-code HEAD run: git diff --exit-code HEAD