Skip to content

Commit

Permalink
fix(core): remove obsolete git track from ci generators
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed May 2, 2024
1 parent 5ded713 commit ab47f77
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 53 deletions.
6 changes: 1 addition & 5 deletions docs/shared/monorepo-ci-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ jobs:
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
- run: npm ci

- uses: nrwl/nx-set-shas@v3

# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}
- uses: nrwl/nx-set-shas@v4

- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build e2e-ci
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ jobs:
- nx/set-shas:
main-branch-name: 'main'
# Required for nx affected if we're on a branch
- run: git branch --track main origin/main
condition: eq(variables['Build.Reason'], 'PullRequest')
- run: npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build e2e-ci
Expand Down Expand Up @@ -167,9 +163,6 @@ jobs:
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build e2e-ci
"
Expand Down Expand Up @@ -208,9 +201,6 @@ jobs:
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build e2e-ci
"
Expand Down Expand Up @@ -334,10 +324,6 @@ jobs:
- nx/set-shas:
main-branch-name: 'main'
# Required for nx affected if we're on a branch
- run: git branch --track main origin/main
condition: eq(variables['Build.Reason'], 'PullRequest')
- run: npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build
Expand Down Expand Up @@ -383,9 +369,6 @@ jobs:
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build
"
Expand Down Expand Up @@ -424,9 +407,6 @@ jobs:
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build
"
Expand Down Expand Up @@ -588,10 +568,6 @@ jobs:
- nx/set-shas:
main-branch-name: 'main'
# Required for nx affected if we're on a branch
- run: git branch --track main origin/main
condition: eq(variables['Build.Reason'], 'PullRequest')
- run: pnpm exec nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build
Expand Down Expand Up @@ -641,9 +617,6 @@ jobs:
- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: pnpm exec nx-cloud record -- nx format:check
- run: pnpm exec nx affected -t lint test build
"
Expand Down Expand Up @@ -686,9 +659,6 @@ jobs:
- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: pnpm exec nx-cloud record -- nx format:check
- run: pnpm exec nx affected -t lint test build
"
Expand Down Expand Up @@ -841,10 +811,6 @@ jobs:
- nx/set-shas:
main-branch-name: 'main'
# Required for nx affected if we're on a branch
- run: git branch --track main origin/main
condition: eq(variables['Build.Reason'], 'PullRequest')
- run: yarn nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build
Expand Down Expand Up @@ -890,9 +856,6 @@ jobs:
- run: yarn install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: yarn nx-cloud record -- nx format:check
- run: yarn nx affected -t lint test build
"
Expand Down Expand Up @@ -931,9 +894,6 @@ jobs:
- run: yarn install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- run: git branch --track main origin/main
if: \${{ github.event_name == 'pull_request' }}
- run: yarn nx-cloud record -- nx format:check
- run: yarn nx affected -t lint test build
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"

- script: <%= packageManagerInstall %>
- script: git branch --track main origin/main
- script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
condition: eq(variables['Build.Reason'], 'PullRequest')

- script: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ jobs:
- nx/set-shas:
main-branch-name: '<%= mainBranch %>'

# Required for nx affected if we're on a branch
- run: git branch --track main origin/main
condition: eq(variables['Build.Reason'], 'PullRequest')

- run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,5 @@ jobs:
- run: <%= packageManagerInstall %>
- uses: nrwl/nx-set-shas@v4

- run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}

- run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check
- run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>

0 comments on commit ab47f77

Please sign in to comment.