Skip to content

Commit

Permalink
[ci] Speed up CI (#7277)
Browse files Browse the repository at this point in the history
* [ci] Speed up site lint job

* fix

* also speed up analyze
  • Loading branch information
poteto authored Nov 3, 2024
1 parent ab51439 commit 8201e7e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@ jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: yarn
cache-dependency-path: yarn.lock

- name: Install dependencies
uses: bahmutov/[email protected]
- name: Restore cached node_modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install deps
run: yarn install --frozen-lockfile

- name: Restore next build
uses: actions/cache@v3
uses: actions/cache@v4
id: restore-build-cache
env:
cache-name: cache-next-build
Expand All @@ -41,7 +49,7 @@ jobs:
run: npx -p [email protected] report

- name: Upload bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: .next/analyze/__bundle_analysis.json
name: bundle_analysis.json
Expand Down Expand Up @@ -73,7 +81,7 @@ jobs:
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare

- name: Upload analysis comment
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: analysis_comment.txt
path: .next/analyze/__bundle_analysis_comment.txt
Expand All @@ -82,7 +90,7 @@ jobs:
run: echo ${{ github.event.number }} > ./pr_number

- name: Upload PR number
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pr_number
path: ./pr_number
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/site_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ jobs:
name: Lint on node 20.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
cache-dependency-path: yarn.lock

- name: Install deps and build (with cache)
uses: bahmutov/[email protected]
- name: Restore cached node_modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install deps
run: yarn install --frozen-lockfile

- name: Lint codebase
run: yarn ci-check

0 comments on commit 8201e7e

Please sign in to comment.