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 3fe6c60
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 23 deletions.
93 changes: 76 additions & 17 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,100 @@ 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
test:
name: Test

- name: Save pnpm cache
if: always() && 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 }}

generate:
name: Generate
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
- run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Generate
run: pnpm run --recursive --parallel --aggregate-output generate
- name: Check diff
run: git diff --name-only --exit-code

- name: Save pnpm cache
if: always() && 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: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
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: pnpm install --frozen-lockfile --strict-peer-dependencies

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

- name: Save pnpm cache
if: always() && 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 }}
12 changes: 6 additions & 6 deletions frontend/packages/proto/proto/admin/v1/team_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fe6c60

Please sign in to comment.