From a59230a3475dea8b52f2400d4c918e9b715bcbc9 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:07:48 -0500 Subject: [PATCH 01/10] chore: log a message --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..38abb3c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,15 @@ +name: CI +on: + push: + branches: + # Change this if your primary branch is not main + - main + pull_request: + +jobs: + main: + runs-on: ubuntu-latest + steps: + - run: + name: Print a message + command: echo "Hello GitHub Actions!" From 12185734387643b4ad2af1a87863dbe7a560c432 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:09:29 -0500 Subject: [PATCH 02/10] chore: log a message --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38abb3c..59e85d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,4 @@ jobs: main: runs-on: ubuntu-latest steps: - - run: - name: Print a message - command: echo "Hello GitHub Actions!" + - run: echo "Hello GitHub Actions!" From 260ab15861250a4db93afcdb7d5e37edb0a95a78 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:16:36 -0500 Subject: [PATCH 03/10] chore(ci): build one app --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59e85d9..8d4660a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,4 +10,8 @@ jobs: main: runs-on: ubuntu-latest steps: - - run: echo "Hello GitHub Actions!" + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: pnpm install --frozen-lockfile + - run: pnpm nx build cart From e9079c88464b73e6b7bb53d4013a5a1598bad01d Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:22:16 -0500 Subject: [PATCH 04/10] chore(ci): build one app --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d4660a..9e4b70d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI on: push: branches: - # Change this if your primary branch is not main - main pull_request: @@ -13,5 +12,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + # Setup pnpm + - uses: pnpm/action-setup@v2 + with: + version: 8 - run: pnpm install --frozen-lockfile - run: pnpm nx build cart From 57ff909345c99840483157dc7310c87a4b51225a Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:32:18 -0500 Subject: [PATCH 05/10] chore(ci): cache dependencies --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e4b70d..18f36c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: push: branches: + # Change this if your primary branch is not main - main pull_request: @@ -12,9 +13,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - # Setup pnpm - uses: pnpm/action-setup@v2 with: version: 8 + # Cache node_modules + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'pnpm' - run: pnpm install --frozen-lockfile - run: pnpm nx build cart From 7febb9fa9484ba453fa48002bfec10c6f8105682 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:41:36 -0500 Subject: [PATCH 06/10] chore(ci): cache dependencies --- .github/workflows/ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18f36c5..60c99e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,21 @@ jobs: - uses: pnpm/action-setup@v2 with: version: 8 - # Cache node_modules - - uses: actions/setup-node@v3 + - name: Restore cached npm dependencies + id: cache-dependencies-restore + uses: actions/cache/restore@v3 with: - node-version: 20 - cache: 'pnpm' + path: | + node_modules + ~/.cache/Cypress # needed for the Cypress binary + key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }} - run: pnpm install --frozen-lockfile + - name: Cache npm dependencies + id: cache-dependencies-save + uses: actions/cache/save@v3 + with: + path: | + node_modules + ~/.cache/Cypress # needed for the Cypress binary + key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} - run: pnpm nx build cart From bb5c4755796dd3646b0e2f0758d417414006470e Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:50:57 -0500 Subject: [PATCH 07/10] chore(ci): cache dependencies --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60c99e7..e9f2374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI on: push: branches: - # Change this if your primary branch is not main - main pull_request: From d8facc5eec27fbb51c4956726d480e3b3a9a9fcc Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:53:28 -0500 Subject: [PATCH 08/10] chore(ci): run affected --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9f2374..c097c91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,5 @@ jobs: node_modules ~/.cache/Cypress # needed for the Cypress binary key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} - - run: pnpm nx build cart + - run: pnpm nx affected -t lint,test,build --parallel=3 --configuration=ci + - run: pnpm nx affected -t e2e --parallel=1 From dd3a8ae732e7a21a5971ba4eef27293f555c38f8 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:54:43 -0500 Subject: [PATCH 09/10] chore(ci): run affected --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c097c91..461080e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,8 @@ jobs: node_modules ~/.cache/Cypress # needed for the Cypress binary key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} + - 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 - run: pnpm nx affected -t lint,test,build --parallel=3 --configuration=ci - run: pnpm nx affected -t e2e --parallel=1 From a8e6b0348a97bbfb89935a7e0eda7489624426b6 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 15 Nov 2023 16:57:45 -0500 Subject: [PATCH 10/10] chore(ci): run affected --- nx.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 89fb439..121ec35 100644 --- a/nx.json +++ b/nx.json @@ -75,7 +75,10 @@ }, "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], - "sharedGlobals": ["{workspaceRoot}/babel.config.json"], + "sharedGlobals": [ + "{workspaceRoot}/babel.config.json", + "{workspaceRoot}/.github/workflows/ci.yml" + ], "production": [ "default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",