Revert "Revert "feat(repo): enable agents" (#19112)"

This reverts commit 3771c325bc50bb2acbca45966f2a2fd39d7f0af6.
This commit is contained in:
Jason Jean 2023-09-20 12:47:16 -04:00 committed by Victor Savkin
parent 3b3fc92928
commit bda90c4cc5
5 changed files with 100 additions and 107 deletions

View File

@ -69,91 +69,10 @@ commands:
- ~/.pnpm-store - ~/.pnpm-store
- ~/.cache/Cypress - ~/.cache/Cypress
- node_modules - node_modules
setup:
parameters:
os:
type: string
steps:
- checkout
- when:
condition:
equal: [<< parameters.os >>, macos]
steps:
- restore_cache:
name: Restore Homebrew packages
keys:
- nrwl-nx-homebrew-packages
- run:
name: Configure Detox Environment, Install applesimutils
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
no_output_timeout: 20m
- save_cache:
name: Save Homebrew Cache
key: nrwl-nx-homebrew-packages
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
- when:
condition:
equal: [<< parameters.os >>, linux]
steps:
- run:
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run-pnpm-install:
os: << parameters.os >>
# ------------------------- # -------------------------
# JOBS # JOBS
# ------------------------- # -------------------------
jobs: jobs:
# -------------------------
# JOBS: Agent
# -------------------------
agent:
parameters:
os:
type: string
default: 'linux'
pm:
type: string
default: 'pnpm'
executor: << parameters.os >>
environment:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_E2E_CI_CACHE_KEY: e2e-circleci-<< parameters.os >>
SELECTED_PM: << parameters.pm >>
NX_E2E_RUN_E2E: 'true'
NX_VERBOSE_LOGGING: 'true'
NX_NATIVE_LOGGING: 'false'
NX_PERF_LOGGING: 'false'
steps:
- run:
name: Configure git metadata (needed for lerna smoke tests)
command: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- run:
name: Set dynamic nx run variable
command: |
echo "export NX_CI_EXECUTION_ENV=\"<< parameters.os >>\";" >> $BASH_ENV
- setup:
os: << parameters.os >>
- run:
name: Agent
command: pnpm nx-cloud start-agent
no_output_timeout: 60m
# ------------------------- # -------------------------
# JOBS: Main Linux # JOBS: Main Linux
# ------------------------- # -------------------------
@ -165,16 +84,21 @@ jobs:
NX_DAEMON: 'true' NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false' NX_PERF_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false' NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'linux'
steps: steps:
- checkout
- run: npx nx-cloud@next start-ci-run --stop-agents-after="e2e"
- run: - run:
name: Set dynamic nx run variable
command: | command: |
echo "export NX_CI_EXECUTION_ENV=\"linux\";" >> $BASH_ENV sudo apt-get update
- setup: sudo apt-get install -y ca-certificates lsof
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run-pnpm-install:
os: linux os: linux
- nx/set-shas: - nx/set-shas:
main-branch-name: 'master' main-branch-name: 'master'
- run: pnpm nx-cloud start-ci-run --stop-agents-after="e2e"
- run: - run:
name: Check Documentation name: Check Documentation
command: pnpm nx documentation --no-dte command: pnpm nx documentation --no-dte
@ -206,13 +130,28 @@ jobs:
environment: environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-macos NX_E2E_CI_CACHE_KEY: e2e-circleci-macos
NX_PERF_LOGGING: 'false' NX_PERF_LOGGING: 'false'
NX_CI_EXECUTION_ENV: 'macos'
SELECTED_PM: 'npm' # explicitly define npm for macOS tests SELECTED_PM: 'npm' # explicitly define npm for macOS tests
steps: steps:
- checkout
- restore_cache:
name: Restore Homebrew packages
keys:
- nrwl-nx-homebrew-packages
- run: - run:
name: Set dynamic nx run variable name: Configure Detox Environment, Install applesimutils
command: | command: |
echo "export NX_CI_EXECUTION_ENV=\"macos\";" >> $BASH_ENV HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
- setup: HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
no_output_timeout: 20m
- save_cache:
name: Save Homebrew Cache
key: nrwl-nx-homebrew-packages
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
- run-pnpm-install:
os: macos os: macos
- rust/install - rust/install
- nx/set-shas: - nx/set-shas:
@ -231,22 +170,6 @@ workflows:
build: build:
jobs: jobs:
- agent:
name: 'agent1'
- agent:
name: 'agent2'
- agent:
name: 'agent3'
- agent:
name: 'agent4'
- agent:
name: 'agent5'
- agent:
name: 'agent6'
- agent:
name: 'agent7'
- agent:
name: 'agent8'
- main-linux - main-linux
- mainmacos: - mainmacos:
name: main-macos-e2e name: main-macos-e2e

11
.gitignore vendored
View File

@ -36,8 +36,19 @@ CHANGELOG.md
# Local dev files # Local dev files
.env .env
.bashrc .bashrc
.nx
*.node *.node
# Fix for issue when working on the repo in a dev container # Fix for issue when working on the repo in a dev container
.pnpm-store .pnpm-store
.nx/cache
.cargo/.package-cache
.cargo/bin/
.cargo/env
.cargo/registry/
.local/
.npm/
.profile
.rustup/

58
.nx/workflows/agents.yaml Normal file
View File

@ -0,0 +1,58 @@
parallelism: 8
env:
CI: 'true'
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_E2E_CI_CACHE_KEY: e2e-circleci-linux
NX_VERBOSE_LOGGING: 'false'
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
SELECTED_PM: 'pnpm'
NX_E2E_RUN_E2E: 'true'
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
steps:
- name: Git Clone
script: |
git init .
git remote add origin $GIT_REPOSITORY_URL
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +{{nxCommitSha}}:{{nxCommitRef}}
git checkout --progress --force -B {{nxBranch}} {{nxCommitRef}}
- name: Restore cache
script: |
nxw cache restore {{nxBranch}}-node_modules node_modules
nxw cache restore {{nxBranch}}-cypress ~/.cache/Cypress
nxw cache restore {{nxBranch}}-pnpm-store ~/.pnpm-store
- name: Install Pnpm
script: |
npm install -g @pnpm/exe@8.3.1
- name: Pnpm Install
script: |
pnpm install --frozen-lockfile
- name: Install Rust
script: |
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Configure git metadata (needed for lerna smoke tests)
script: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Run Agent
script: |
source "$HOME/.cargo/env"
npx nx-cloud start-agent
- name: Store to cache
script: |
nxw cache store {{nxBranch}}-node_modules node_modules
nxw cache store {{nxBranch}}-cypress ~/.cache/Cypress
nxw cache store {{nxBranch}}-pnpm-store ~/.pnpm-store

View File

@ -136,7 +136,8 @@ export function ensureCypressInstallation() {
} }
export function ensurePlaywrightBrowsersInstallation() { export function ensurePlaywrightBrowsersInstallation() {
execSync('npx playwright install --with-deps --force', { const playwrightInstallArgs = process.env.PLAYWRIGHT_INSTALL_ARGS || '';
execSync(`npx playwright install ${playwrightInstallArgs}`, {
stdio: isVerbose() ? 'inherit' : 'pipe', stdio: isVerbose() ? 'inherit' : 'pipe',
encoding: 'utf-8', encoding: 'utf-8',
cwd: tmpProjPath(), cwd: tmpProjPath(),

View File

@ -10,8 +10,8 @@
"accessToken": "YmZiOWQyNzctOThiZC00MjYwLWI3YTAtZDA3MDg4YWY1YTExfHJlYWQ=", "accessToken": "YmZiOWQyNzctOThiZC00MjYwLWI3YTAtZDA3MDg4YWY1YTExfHJlYWQ=",
"cacheableOperations": [ "cacheableOperations": [
"build", "build",
"lint-base",
"lint", "lint",
"lint-base",
"build-ng", "build-ng",
"build-base", "build-base",
"build-native", "build-native",