Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7254945
Add NX to repo and run tasks off of NX with cache
edison-cy-yang Jun 26, 2025
6323597
circle job setup to save and restore nx cache to circle cache
edison-cy-yang Jun 26, 2025
d70a158
test simple diff
edison-cy-yang Jun 26, 2025
8b65a02
restore nx cache in build_storybook and build_new_docs jobs
edison-cy-yang Jun 26, 2025
02d2ca5
change build output directory so cache can pick it up
edison-cy-yang Jun 26, 2025
d1dd2ad
debug nx cache in circle
edison-cy-yang Jun 26, 2025
31209bf
remove build all step from circle
edison-cy-yang Jun 26, 2025
6dc0da7
oops put e2e_tests step back
edison-cy-yang Jun 26, 2025
b4cdddb
revert storybook build output back to storybook-static
edison-cy-yang Jun 26, 2025
3ea32ca
one more
edison-cy-yang Jun 26, 2025
011bc0a
nx cache bootstrap
edison-cy-yang Jun 27, 2025
e3fa1e2
setup bootstrap nx task and cache it
edison-cy-yang Jun 27, 2025
a1c442f
clear nx cache if failure
edison-cy-yang Jun 27, 2025
b1abe06
dont create build.log
edison-cy-yang Jun 27, 2025
76a43a5
dont use nx cache in install_dependencies for now
edison-cy-yang Jul 3, 2025
ef01db8
circle nx cache key too specific
edison-cy-yang Jul 3, 2025
1975fd2
only use branch name as cache key
edison-cy-yang Jul 3, 2025
0fc6ac5
tweak storybook:build nx inputs
edison-cy-yang Jul 4, 2025
5534711
add epoch to circleCI cache key
edison-cy-yang Jul 4, 2025
ba430e3
no epoch
edison-cy-yang Jul 4, 2025
c665fe6
debug
edison-cy-yang Jul 4, 2025
d401624
only try to save cache in one job
edison-cy-yang Jul 4, 2025
6b6f453
run restore and save nx cache as jobs not steps
edison-cy-yang Jul 4, 2025
c3482f8
test again with epoch cache key
edison-cy-yang Jul 5, 2025
dcaf149
edited the wrong job
edison-cy-yang Jul 5, 2025
9c867d3
another config test
edison-cy-yang Jul 5, 2025
e9fd45b
is this correct
edison-cy-yang Jul 5, 2025
490241c
I think this is correct
edison-cy-yang Jul 5, 2025
49a1224
more test with epoch and restore save in each job
edison-cy-yang Jul 5, 2025
3465aa2
restore cache at the beginning and save at the end
edison-cy-yang Jul 7, 2025
fef7557
start fresh with new key
edison-cy-yang Jul 7, 2025
6389d32
debug
edison-cy-yang Jul 7, 2025
3c51364
make sure bootstrap task is mapped to each build task to utilize the …
edison-cy-yang Jul 7, 2025
2afcac1
persist to workspace after each build
edison-cy-yang Jul 7, 2025
4cc3561
cache src/assets
edison-cy-yang Jul 7, 2025
7337713
start fresh with new cache key
edison-cy-yang Jul 8, 2025
1a95c18
persist only nx cache to workspace
edison-cy-yang Jul 21, 2025
d4f2482
combine build_storybook and build_new_docs jobs to use the same nx cache
edison-cy-yang Jul 21, 2025
15b313e
add nx run affect test
edison-cy-yang Jul 22, 2025
7cec708
test task should not depend on build
edison-cy-yang Jul 22, 2025
430b5b4
run test from source file not build
edison-cy-yang Jul 22, 2025
582ee2b
persist nx cache after test
edison-cy-yang Jul 22, 2025
dadce58
only run test on components-native source files
edison-cy-yang Jul 22, 2025
e0c2b6b
test:affected with --verbose
edison-cy-yang Jul 22, 2025
c2039af
update test config
edison-cy-yang Jul 22, 2025
90b7352
start fresh with new nx cache key
edison-cy-yang Jul 22, 2025
a627e46
dont try to run test with nx affected for now
edison-cy-yang Jul 22, 2025
c155503
jest setup with nx tweak and run test in build_all_and_test
edison-cy-yang Jul 22, 2025
b582400
lets try again with test path
edison-cy-yang Jul 23, 2025
768b1a6
sepatate test back into its own job
edison-cy-yang Jul 23, 2025
eda42d1
set --head to branch name when running in CI
edison-cy-yang Jul 23, 2025
1427232
ignore .nx directory in tests
edison-cy-yang Jul 23, 2025
01c5744
don run CI tests with nx
edison-cy-yang Jul 23, 2025
88b59c2
remove debug nx cache from ci jobs
edison-cy-yang Jul 23, 2025
03b943d
bump nx cache key version
edison-cy-yang Jul 23, 2025
57ffe0b
Merge branch 'master' of github.com:GetJobber/atlantis into edi/nx
edison-cy-yang Jul 23, 2025
38a338b
remove useNx from lerna config
edison-cy-yang Jul 23, 2025
9c38c4b
remove test change
edison-cy-yang Jul 23, 2025
0ffa0f5
remove extra project.json for docx
edison-cy-yang Jul 23, 2025
ffe329c
remove extra line break
edison-cy-yang Jul 23, 2025
37df567
remove project.json for eslint-config
edison-cy-yang Jul 23, 2025
cef2d1f
remove root project.json description
edison-cy-yang Jul 23, 2025
a41de66
comment update
edison-cy-yang Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 69 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ references:
keys:
- npm-cache-v1

restore_nx_cache: &restore_nx_cache
restore_cache:
name: Restore NX cache
key: nx-cache-v11-{{ .Branch }}-



attach_workspace: &attach_workspace
attach_workspace:
at: .
Expand All @@ -35,6 +42,19 @@ references:
paths:
- '*'

persist_nx_cache_only: &persist_nx_cache_only
persist_to_workspace:
root: .
paths:
- .nx/cache

save_nx_cache: &save_nx_cache
save_cache:
name: Save NX cache
key: nx-cache-v11-{{ .Branch }}-{{ epoch }}
paths:
- .nx/cache

npm_install: &npm_install
run:
name: Install Dependencies
Expand Down Expand Up @@ -88,6 +108,7 @@ jobs:
<<: *container_config
steps:
- *attach_workspace
- *restore_nx_cache
- *restore_npm_cache
- run:
name: Authenticate with npm
Expand Down Expand Up @@ -137,7 +158,7 @@ jobs:
steps:
- *attach_workspace
- run:
name: "Run tests with jest"
name: "Run tests with Jest"
command:
npm test -- --runInBand --no-cache --coverage --reporters=jest-junit
environment:
Expand All @@ -152,22 +173,49 @@ jobs:
- store_artifacts:
path: coverage

build_storybook:
build_all:
resource_class: medium+
<<: *container_config
steps:
- *attach_workspace
- *generate_base_path
- run:
command: npm run storybook:build
- *check_git_status

build_new_docs:
<<: *container_config
steps:
- *attach_workspace
name: Build Storybook with NX
command: |
echo "=== Starting Storybook Build ==="
echo "Running: npm run storybook:build"
echo "This should use NX caching if available..."

# Show NX cache status before build
echo "=== NX Cache Status Before Build ==="
npx nx show projects --affected || echo "No affected projects or NX not available"
echo "=== End NX Cache Status ==="

# Run the build and capture output
if npm run storybook:build; then
echo "=== Storybook Build Complete ==="
else
echo "=== Build Failed ==="
fi
- run:
command: cd packages/site && npm run generate && npm run build
name: Build Site with NX
command: |
echo "=== Starting Site Build ==="
echo "Running: npm run site:build"
echo "This should use NX caching if available..."

# Show NX cache status before build
echo "=== NX Cache Status Before Build ==="
npx nx show projects --affected || echo "No affected projects or NX not available"
echo "=== End NX Cache Status ==="

# Run the build and capture output
if npm run site:build; then
echo "=== Site Build Complete ==="
else
echo "=== Build Failed ==="
fi
- *persist_nx_cache_only
- *check_git_status

release:
Expand Down Expand Up @@ -222,6 +270,12 @@ jobs:
- store_artifacts:
path: packages/site/test-results

save_nx_cache:
<<: *container_config
steps:
- *attach_workspace
- *save_nx_cache

workflows:
version: 2

Expand All @@ -243,15 +297,15 @@ workflows:
- test:
requires:
- install_dependencies
- build_storybook:
requires:
- install_dependencies
- build_new_docs:
- build_all:
requires:
- install_dependencies
- e2e_tests:
requires:
- install_dependencies
- save_nx_cache:
requires:
- build_all
- release:
filters:
branches:
Expand All @@ -260,6 +314,5 @@ workflows:
- lint_javascript
- lint_css
- test
- build_storybook
- build_new_docs
- build_all
- e2e_tests
18 changes: 18 additions & 0 deletions .github/workflows/trigger-qa-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,25 @@ jobs:
registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
scope: '@jobber'
cache: 'npm'

- name: Setup NX Cache
uses: actions/cache@v3
with:
path: .nx/cache
key: nx-cache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
nx-cache-${{ runner.os }}-${{ github.ref_name }}-
nx-cache-${{ runner.os }}-

- name: NPM CI
run: npm ci

- name: Build with NX (if needed)
run: npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.JOBBER_NPM_TOKEN }}

- name: NPM Publish
id: npmPublish
env:
Expand Down Expand Up @@ -73,6 +90,7 @@ jobs:
- name: Send Summary File
id: summaryFile
run: echo "releaseSummary=$(cat ./lerna-publish-summary.json)" >> $GITHUB_OUTPUT

send_build_information:
permissions: write-all
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ storybook-static
jobber-*.tgz
.npmrc
styles.css.backup

# NX cache
.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ packages/generators/templates
packages/components/dist/styles.css
packages/design/icons/
**/CHANGELOG.md

/.nx/cache
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ module.exports = {
// ],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ["/node_modules/", "/packages/generators/templates/"],
testPathIgnorePatterns: [
"/node_modules/",
"/packages/generators/templates/",
"/.nx/",
],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
Expand Down
1 change: 1 addition & 0 deletions jest.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {
"/node_modules/",
"/packages/generators/templates/",
"/packages/components-native/",
"/.nx/",
],
transformIgnorePatterns: ["node_modules/(?!@codesandbox/sandpack-react)/"],
};
106 changes: 106 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"bootstrap",
"storybook:build",
"site:build",
"merge:dist",
"generate:sitemap",
"test"
],
"parallel": 3
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": [
"default",
"^default",
"{projectRoot}/**/*.{ts,tsx,js,jsx,json,css,md,mdx}",
"{projectRoot}/rollup.config.*",
"{projectRoot}/tsconfig.json",
"{projectRoot}/vite.config.*"
],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"bootstrap": {
"dependsOn": ["^bootstrap"],
"inputs": [
"default",
"^default",
"{projectRoot}/**/*.{ts,tsx,js,jsx,json,css,md,mdx}",
"{projectRoot}/rollup.config.*",
"{projectRoot}/tsconfig.json",
"{projectRoot}/vite.config.*"
],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"test": {
"inputs": [
"default",
"^default",
"{projectRoot}/**/*.{ts,tsx,js,jsx}",
"{projectRoot}/**/*.test.{ts,tsx,js,jsx}",
"{projectRoot}/**/*.spec.{ts,tsx,js,jsx}",
"{projectRoot}/jest.config.*",
"!{projectRoot}/node_modules/**/*"
],
"outputs": ["{projectRoot}/coverage"],
"cache": true
},
"storybook:build": {
"dependsOn": ["^build"],
"inputs": [
"default",
"^default",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/docs/**/*"
],
"outputs": ["{projectRoot}/storybook-static"],
"cache": true
},
"site:build": {
"dependsOn": ["^build"],
"inputs": [
"default",
"^default",
"{projectRoot}/packages/site/**/*",
"{projectRoot}/packages/site/public/**/*",
"{projectRoot}/packages/site/src/**/*"
],
"outputs": ["{projectRoot}/packages/site/dist"],
"cache": true
},
"merge:dist": {
"dependsOn": ["storybook:build", "site:build"],
"inputs": [
"{projectRoot}/storybook-static/**/*",
"{projectRoot}/packages/site/dist/**/*"
],
"outputs": ["{projectRoot}/storybook-static"],
"cache": true
},
"generate:sitemap": {
"cache": true
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"!{projectRoot}/node_modules/**/*",
"!{projectRoot}/dist/**/*",
"!{projectRoot}/storybook-static/**/*"
]
},
"parallel": 3,
"defaultBase": "master"
}
Loading