Skip to content

Commit

Permalink
ci: use pnpm instead of yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho-vazquez committed May 28, 2024
1 parent 1b4d37a commit 2d1c2f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
14 changes: 6 additions & 8 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ runs:
id: node_version
shell: bash
run: echo "node_version=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- uses: pnpm/action-setup@v2
with:
version: 8.15.7
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ steps.node_version.outputs.node_version }}
# This doesn't just set the registry url, but also sets
# the right configuration in .npmrc that reads NPM token
# from NPM_AUTH_TOKEN environment variable.
# It actually creates a .npmrc in a temporary folder
# and sets the NPM_CONFIG_USERCONFIG environment variable.
registry-url: https://registry.npmjs.org
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: yarn install --immutable --immutable-cache
run: pnpm install
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ jobs:
# in the parallel-commands-on-agents command list
# The --agent-count parameter must match the number-of-agents parameter
init-commands: |
yarn nx-cloud start-ci-run --stop-agents-after="e2e" --agent-count=4
pnpm exec nx-cloud start-ci-run --stop-agents-after="e2e" --agent-count=4
# Commands run in parallel on this DTE coordinator
parallel-commands: |
yarn nx-cloud record -- yarn nx format:check
pnpm exec nx-cloud record -- yarn nx format:check
# Commands distributed between DTE agents
# Distribution strategy for 2 vCPUs per hosted runner (GitHub Free):
# lint: 2 tasks assigned at a time, 1 task per vCPU
# test: 1 task assigned at a time with 2 parallel processes, 1 process per vCPU
# build: 2 tasks assigned at a time, 1 task per vCPU
# e2e: 1 task assigned at a time, 1 task total
parallel-commands-on-agents: |
yarn nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0
yarn nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2
yarn nx affected --target=build --parallel=2
yarn nx affected --target=e2e --parallel=1
pnpm exec nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0
pnpm exec nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2
pnpm exec nx affected --target=build --parallel=2
pnpm exec nx affected --target=e2e --parallel=1
# Commands run sequentially on this DTE coordinator after parallel jobs
# final-commands: |

Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
uses: ./.github/actions/setup
# Uses the cache generated in the distributed step
- name: Build docs
run: yarn nx build docs-lumberjack-docs-app
run: pnpm exec nx build docs-lumberjack-docs-app
- name: Set up GitHub Pages
uses: actions/configure-pages@v4
- name: Upload docs to GitHub Pages
Expand Down Expand Up @@ -138,13 +138,13 @@ jobs:
uses: ./.github/actions/setup
# Uses the cache generated in the distributed step (Needed for the sonar eslint reports).
- name: Lint with reports
run: yarn nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0
run: pnpm exec nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0
# Uses the cache generated in the distributed step (Needed for the sonar jest coverage reports).
- name: Tests with coverage
run: yarn nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2
run: pnpm exec nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2

- name: Configure Sonar report paths
run: yarn configure-sonar-report-paths
run: pnpm exec configure-sonar-report-paths

- name: SonarCloud Scan
uses: sonarsource/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# Generates the changelog commit and tags and pushes them to Github.
# Use two post actions to Create a release in Github and for Publishing the package to NPM
shell: bash
run: npx nx version ngworker-lumberjack --releaseAs=${{ github.event.inputs.release_as }}
run: pnpm exec nx version ngworker-lumberjack --releaseAs=${{ github.event.inputs.release_as }}

# Needed if we want to automize multiple releases with the affected commands.
- name: Tag last-release
Expand Down

0 comments on commit 2d1c2f8

Please sign in to comment.