From: Jérôme Benoit Date: Sat, 22 Apr 2023 22:04:25 +0000 (+0200) Subject: build(ci): enable dependencies caching with pnpm X-Git-Tag: v2.4.11~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4c15652154b608102bae65165dfa151f91569151;p=poolifier.git build(ci): enable dependencies caching with pnpm Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7854d04d..72782830 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,29 +28,32 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis. This is needed for better sonar + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Setup node ${{ matrix.node }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} + cache: 'pnpm' - name: Install - run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm install + run: pnpm install - name: Build - run: pnpm run build + run: pnpm build - name: Lint - run: pnpm run lint + run: pnpm lint - name: Tests - run: pnpm run test + run: pnpm test - name: Coverage Report if: "github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" - run: pnpm run coverage + run: pnpm coverage - name: Sonar Code Analysis if: "github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" @@ -61,4 +64,4 @@ jobs: - name: Benchmark if: github.event.inputs.withBenchmark - run: pnpm run benchmark + run: pnpm benchmark diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml index 82553b24..2ba7833e 100644 --- a/.github/workflows/generate-documentation.yml +++ b/.github/workflows/generate-documentation.yml @@ -11,17 +11,21 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Setup node uses: actions/setup-node@v3 with: node-version: '18.x' + cache: 'pnpm' - name: Generate documentation run: | - corepack enable - corepack prepare pnpm@latest --activate pnpm install - pnpm run typedoc + pnpm typedoc - name: Commit files if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'" diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index d124eed3..17eb40ed 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -12,27 +12,30 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18.x' + cache: 'pnpm' - name: Install - run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm install + run: pnpm install - name: Tests & Coverage run: | - pnpm run test - pnpm run coverage + pnpm test + pnpm coverage - name: Lint - run: pnpm run lint + run: pnpm lint - name: Production Build - run: pnpm run build:prod + run: pnpm build:prod publish: needs: build @@ -42,21 +45,24 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18.x' registry-url: https://registry.npmjs.org/ + cache: 'pnpm' - name: Read package.json version id: package-version uses: jaywcjlove/github-action-package@main - name: Install - run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm install + run: pnpm install - name: Publish Release if: ${{ contains(steps.package-version.outputs.version, '-') == false }}