Skip to content

Commit

Permalink
chore(ci): rewrite frontend ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tosuke committed Dec 17, 2024
1 parent e1b0671 commit 7a3e8fa
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,63 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore pnpm cache
uses: actions/cache/restore@v4
id: pnpm-cache
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
restore-keys: |
pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: frontend/package.json
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Lint
run: pnpm run --recursive --parallel --aggregate-output lint

- name: Save pnpm cache
if: steps.pnpm-cache.outputs.cache-hit != 'true' # && github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: ~/.pnpm-store
key: ${{ steps.pnpm-cache.outputs.cache-primary-key }}
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore pnpm cache
uses: actions/cache/restore@v4
id: pnpm-cache
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
restore-keys: |
pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: frontend/package.json
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Test
run: pnpm run --recursive --parallel --aggregate-output test

- name: Save pnpm cache
if: steps.pnpm-cache.outputs.cache-hit != 'true' # && github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: ~/.pnpm-store
key: ${{ steps.pnpm-cache.outputs.cache-primary-key }}

0 comments on commit 7a3e8fa

Please sign in to comment.