Skip to content

Commit

Permalink
feat(core): use macos nx cloud agents
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jun 28, 2024
1 parent 336d371 commit bcd43af
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 11 deletions.
11 changes: 8 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- checkout
- nx/set-shas:
main-branch-name: 'master'
- run: npx nx-cloud@next start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- run: npx nx-cloud@next start-ci-run --distribute-on=".nx/workflows/dynamic-changesets-linux.yaml" --stop-agents-after="e2e"
- run:
command: |
sudo apt-get update
Expand Down Expand Up @@ -128,11 +128,18 @@ jobs:
executor: macos
environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-macos
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'macos'
SELECTED_PM: 'npm' # explicitly define npm for macOS tests
NX_CLOUD_DTE_V2: 'true'
steps:
- checkout
- nx/set-shas:
main-branch-name: 'master'
- run: npx nx-cloud@next start-ci-run --distribute-on=".nx/workflows/dynamic-changesets-macos.yaml" --stop-agents-after="e2e-macos-ci"
- restore_cache:
name: Restore Homebrew packages
keys:
Expand All @@ -153,8 +160,6 @@ jobs:
- run-pnpm-install:
os: macos
- rust/install
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Run E2E Tests for macOS
command: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tmp
jest.debug.config.js
.tool-versions
/.nx-cache
/.nx
/.verdaccio/build/local-registry
/graph/client/src/assets/environment.js
/graph/client/src/assets/dev/environment.js
Expand Down
51 changes: 44 additions & 7 deletions .nx/workflows/agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ launch-templates:
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v3.6/workflow-steps/checkout/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v3.6/workflow-steps/cache/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
env:
KEY: 'pnpm-lock.yaml'
PATHS: |
Expand All @@ -31,13 +31,10 @@ launch-templates:
npm install -g pnpm@8
- name: Pnpm Install
script: |
pnpm install --frozen-lockfile
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'

- name: Install Browsers
script: |
pnpm exec cypress install
pnpm exec playwright install
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml'

- name: Install Rust
script: |
Expand All @@ -55,3 +52,43 @@ launch-templates:

- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
macos-medium:
resource-class: 'macos_arm64/medium'
image: nx-agent-macos-sonoma:15.2.0
env:
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
env:
KEY: 'pnpm-lock.yaml'
PATHS: |
node_modules
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
BASE_BRANCH: 'master'

- name: Install Pnpm
script: npm install -g pnpm@8

- name: Install Dependencies Step
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'

- name: Install Browsers
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml'

- name: Install Rust
script: |
curl --proto '=https' https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
File renamed without changes.
4 changes: 4 additions & 0 deletions .nx/workflows/dynamic-changesets-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
distribute-on:
small-changeset: 8 macos-medium
medium-changeset: 10 macos-medium
large-changeset: 12 macos-medium

0 comments on commit bcd43af

Please sign in to comment.