Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NX and NX Cloud config #2519

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
pull_request:
branches:
- main

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.CI_NX_ACCESS_TOKEN }}
jobs:
run-linters:
strategy:
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
branches: [main]
pull_request:
branches: [main]

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.CI_NX_ACCESS_TOKEN }}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down Expand Up @@ -46,12 +47,12 @@ jobs:
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: |
${{ runner.os == 'Windows' }}:
C:\Users\runneradmin\AppData\Local\ms-playwright
${{ runner.os != 'Windows' }}:
~/.cache/ms-playwright
key: playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
path: |
${{ runner.os == 'Windows' }}:
C:\Users\runneradmin\AppData\Local\ms-playwright
${{ runner.os != 'Windows' }}:
~/.cache/ms-playwright
key: playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
- name: Install playwright browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
Expand All @@ -61,11 +62,11 @@ jobs:
if: failure()
uses: actions/upload-artifact@v3
with:
name: playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
path: |
packages/*/playwright-report
!packages/*/node_modules
retention-days: 15
name: playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
path: |
packages/*/playwright-report
!packages/*/node_modules
retention-days: 15
- name: Run SonarCloud scan
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18.x'
uses: sonarsource/sonarcloud-github-action@master
Expand Down Expand Up @@ -163,17 +164,17 @@ jobs:
- name: Prepare Slack notification message
if: steps.changesetPublish.outputs.published == 'true'
run: |
# Random delimiter required to support multi-line environment variable value
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
# publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
# Random delimiter required to support multi-line environment variable value
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
# publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
- name: Send Slack notification
if: steps.changesetPublish.outputs.published == 'true'
uses: slackapi/[email protected]
with:
payload: |
{"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
payload: |
{"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ typings/
pnpm-lock.yaml
**/playwright-report
**/test-results
/.nx/workspace-data
/.nx/workspace-data
/.nx/cache
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"cwd": "${workspaceFolder}/packages/nodejs-utils/"
}
},
{
"type": "node",
"request": "launch",
Expand Down
35 changes: 17 additions & 18 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"test:integration",
"build:extension",
"build:storybook",
"build:storybook:bundle"
],
"accessToken": "ZjFiYzA4OTYtYjFlNS00NTI2LTk4OTktNWZiYTAyMGE0ZGRmfHJlYWQtd3JpdGU=",
"canTrackAnalytics": false,
"showUsageWarnings": true
"showUsageWarnings": true,
"nxCloudId": "63723103eb505e0e8ebeb550"
}
}
},
Expand All @@ -35,30 +25,39 @@
"{projectRoot}/generators",
"{projectRoot}/lib",
"{projectRoot}/storybook"
]
],
"cache": true
},
"test": {
"inputs": ["default", "^prod", "{workspaceRoot}/jest.base.js", "{projectRoot}/jest.config.js"],
"outputs": ["{projectRoot}/coverage"]
"outputs": ["{projectRoot}/coverage"],
"cache": true
},
"test:integration": {
"inputs": ["default", "^prod", "{workspaceRoot}/jest.base.js", "{projectRoot}/jest.config.js"],
"outputs": ["{projectRoot}/playwright-report"]
"outputs": ["{projectRoot}/playwright-report"],
"cache": true
},
"build:extension": {
"outputs": ["{projectRoot}/*.vsix"]
"outputs": ["{projectRoot}/*.vsix"],
"cache": true
},
"build:storybook": {
"outputs": ["{projectRoot}/storybook"]
"outputs": ["{projectRoot}/storybook"],
"cache": true
},
"lint": {
"inputs": ["default", "^prod"]
"inputs": ["default", "^prod"],
"cache": true
},
"lint:fix": {
"inputs": ["default", "^prod"]
},
"clean": {
"inputs": []
},
"build:storybook:bundle": {
"cache": true
}
},
"defaultBase": "main"
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"private": true,
"devDependencies": {
"@changesets/cli": "2.27.7",
"@nrwl/nx-cloud": "19.0.0",
"@playwright/test": "1.39.0",
"@types/jest": "29.5.5",
"@types/node": "18.11.9",
Expand All @@ -25,7 +24,7 @@
"husky": "8.0.3",
"jest": "29.7.0",
"jest-sonar": "0.2.16",
"nx": "18.2.4",
"nx": "20.1.1",
"prettier": "2.8.8",
"pretty-quick": "3.1.3",
"rimraf": "5.0.5",
Expand All @@ -36,7 +35,7 @@
"scripts": {
"postinstall": "update-ts-references",
"clean": "nx run-many --target=clean --all",
"build": "nx run-many --target=build --all",
"build": "nx run-many --target=build --all --verbose",
"format": "pnpm recursive run format",
"lint": "nx run-many --target=lint --all",
"lint:fix": "nx run-many --target=lint:fix --all",
Expand Down
Loading
Loading