Skip to content

Commit

Permalink
chore: ci updates (#3523)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Feb 2, 2023
1 parent 116c62c commit 70de43c
Show file tree
Hide file tree
Showing 16 changed files with 117 additions and 511 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/ci.yml
Expand Up @@ -16,7 +16,7 @@ env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_BRANCH: ${{ github.event.number || github.ref_name }}
NX_VERBOSE_LOGGING: false
NX_VERBOSE_LOGGING: true

jobs:
main:
Expand All @@ -27,23 +27,33 @@ jobs:
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- uses: nrwl/nx-set-shas@v3

- name: Set NX_RUN_GROUP
shell: bash
run: echo "NX_RUN_GROUP=$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-linux" >> $GITHUB_ENV

- name: Log NX_RUN_GROUP
shell: bash
run: echo "NX_RUN_GROUP is ${{ env.NX_RUN_GROUP }}"

- name: Install primary node version (see volta config in package.json) and dependencies
uses: ./.github/actions/install-node-and-dependencies

- run: npx nx run-many -t build --parallel=3 --no-dte --skip-nx-cache

- name: Run parallel distributed tasks
uses: jameshenry/parallel-bash-commands@v1
with:
cmd1: npx nx-cloud record -- npx nx format:check
cmd2: npx nx-cloud record -- npx nx workspace-lint
# cmd3: npx nx run-many -t build --parallel=3
cmd3: npx nx run-many -t lint --parallel=3
cmd4: npx nx run-many -t test --parallel=3 --ci --maxWorkers=2
cmd5: npx nx run integration:integration --ci --maxWorkers=2

# e2e tests for everything except the primary task runner
- run: PUBLISHED_VERSION=999.9.9-e2e.0 npx nx run-many --target=run-e2e-tests-process --parallel=1
- run: PUBLISHED_VERSION=999.9.9-e2e.0 npx nx run-many --t e2e --parallel=1

- name: Stop all running agents for Nx Run Group ${{ env.NX_RUN_GROUP }}
# It's important that we always run this step, otherwise in the case of any failures in preceding non-Nx steps, the agents will keep running and waste billable minutes
Expand All @@ -59,6 +69,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set NX_RUN_GROUP
shell: bash
run: echo "NX_RUN_GROUP=$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-linux" >> $GITHUB_ENV

- name: Log NX_RUN_GROUP
shell: bash
run: echo "NX_RUN_GROUP is ${{ env.NX_RUN_GROUP }}"

- name: Configure git metadata
run: |
git config --global user.email test@example.com
Expand All @@ -67,14 +85,11 @@ jobs:
- name: Install primary node version (see volta config in package.json) and dependencies
uses: ./.github/actions/install-node-and-dependencies

- run: npm run e2e-start-local-registry

- run: NX_VERBOSE_LOGGING=true PUBLISHED_VERSION=999.9.9-e2e.0 npm run e2e-build-package-publish

- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent
env:
NX_AGENT_NAME: ${{ matrix.agent }}
NX_RUN_GROUP: ${{ env.NX_RUN_GROUP }}

windows-main:
name: Nx Cloud - Windows Main Job
Expand All @@ -83,11 +98,6 @@ jobs:
LERNA_OS_TYPE: windows
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3

- name: Set NX_RUN_GROUP
shell: bash
Expand Down Expand Up @@ -150,6 +160,8 @@ jobs:
- name: Install primary node version (see volta config in package.json) and dependencies
uses: ./.github/actions/install-node-and-dependencies

- run: npx nx reset

- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent
env:
Expand Down
41 changes: 3 additions & 38 deletions e2e/changed/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-changed"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-changed"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-changed",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/changed/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/changed"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
41 changes: 3 additions & 38 deletions e2e/clean/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-clean"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-clean"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-clean",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/clean/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/clean"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
41 changes: 3 additions & 38 deletions e2e/create/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-create"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-create"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-create",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/create/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/create"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
41 changes: 3 additions & 38 deletions e2e/diff/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-diff"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-diff"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-diff",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/diff/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/diff"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
41 changes: 3 additions & 38 deletions e2e/exec/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-exec"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-exec"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-exec",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/exec/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/exec"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
41 changes: 3 additions & 38 deletions e2e/info/project.json
Expand Up @@ -4,44 +4,9 @@
"implicitDependencies": ["lerna", "commands-info"],
"tags": [],
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npm run e2e-start-local-registry"
},
{
"command": "npm run e2e-build-package-publish"
},
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-info"
}
],
"parallel": false
}
},
"run-e2e-tests-process": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "E2E_ROOT=$(npx ts-node tools/scripts/set-e2e-root.ts) nx run-e2e-tests e2e-info",
"description": "This additional wrapper target exists so that we can ensure that the e2e tests run in a dedicated process with enough memory"
}
],
"parallel": false
}
},
"run-e2e-tests": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "e2e/info/jest.config.ts",
"passWithNoTests": true,
"runInBand": true
},
"outputs": ["{workspaceRoot}/coverage/e2e/info"]
},
"e2e": {},
"run-e2e-tests-process": {},
"run-e2e-tests": {},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down

0 comments on commit 70de43c

Please sign in to comment.