Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #151

Open
magicdawn opened this issue Nov 17, 2022 · 1 comment
Open

GitHub Actions #151

magicdawn opened this issue Nov 17, 2022 · 1 comment

Comments

@magicdawn
Copy link
Owner

No description provided.

@magicdawn
Copy link
Owner Author

常用

# name: Node.js CI

on:
  - push
  - pull_request

jobs:
  unit-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: pnpm/action-setup@v2
        with: { version: 7 }

      - uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: 'pnpm'

      - run: pnpm install

      - run: pnpm test-cover
      - uses: codecov/codecov-action@v3

pnpm/action-setup

  • 这个仓库内置了一个很大的 pnpm.js, 用于 pnpm add pnpm@指定版本
  • 默认 dest = ~/setup-pnpm
  • 导出 PNPM_HOME = ~/setup-pnpm/node_modules/.bin/, store path 位于 PNPM_HOME/store/v3
  • 不提供 cache 功能, README 引导使用 actions/cache

actions/setup-node

  • 提供 cache 功能, cache: pnpm 会自动 cache pnpm store path 目录, 与 pnpm/action-setup 建议的一样.
  • 会换成 cache path, 而不是 node_modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant