Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 755c21e

Browse files
authored
Merge pull request #1610 from w3bdesign/1608-pnpm
1608 pnpm
2 parents 861c963 + 83aa5e7 commit 755c21e

File tree

5 files changed

+15977
-25520
lines changed

5 files changed

+15977
-25520
lines changed

.circleci/config.yml

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,52 @@
11
version: 2.1
22
orbs:
33
cypress: cypress-io/cypress@3.3.1
4-
codecov: codecov/codecov@4.0.1
4+
codecov: codecov/codecov@3.3.0
55
executors:
66
with-chrome-and-firefox:
77
docker:
8-
- image: "cypress/browsers:node-20.10.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1"
8+
- image: "cypress/browsers:node16.14.2-slim-chrome100-ff99-edge"
99
resource_class: large
1010
jobs:
11-
cypress-run-with-electron:
12-
executor: with-chrome-and-firefox
13-
steps:
14-
- checkout
15-
- run: npm install
16-
- save_cache:
17-
key: v1-dependenciesx-{{ checksum "package.json" }}
18-
paths:
19-
- node_modules
20-
- run:
21-
name: Start Dev Server
22-
command: npm run dev
23-
background: true
24-
- run:
25-
name: Run Cypress E2E tests with Electron
26-
command: |
27-
npx cypress run --browser electron
28-
2911
chromatic-deployment:
3012
docker:
31-
- image: cimg/node:21.6.2
13+
- image: cimg/node:21.5.0
3214
working_directory: ~/chromatic
3315
steps:
3416
- checkout
3517
- restore_cache:
3618
keys:
37-
- v1-dependencies-{{ checksum "package.json" }}
38-
- v1-dependencies-cache
39-
- run: yarn install
40-
- run: yarn chromatic --project-token=${CHROMATIC_PROJECT_TOKEN}
19+
- pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }}
20+
- pnpm-packages-cache-v1
21+
- run:
22+
name: Install pnpm package manager
23+
command: |
24+
sudo corepack enable
25+
sudo corepack prepare pnpm@latest-8 --activate
26+
- run:
27+
name: Install Dependencies
28+
command: pnpm install --frozen-lockfile
29+
- run: pnpm run chromatic -- --project-token=${CHROMATIC_PROJECT_TOKEN}
30+
- save_cache:
31+
key: pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }}
32+
paths:
33+
- ~/.pnpm-store
4134
build:
4235
working_directory: /home/circleci/dfweb
4336
docker:
44-
- image: cimg/base:stable
37+
- image: cimg/node:21.5.0-browsers
4538
steps:
4639
- checkout
40+
- restore_cache:
41+
key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }}
4742
- run:
48-
name: Install NVM and Node.js
49-
command: |
50-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
51-
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
52-
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
53-
source $BASH_ENV
54-
nvm install 18.17.0
55-
- run:
56-
name: Verify Node.js version
43+
name: Install pnpm package manager
5744
command: |
58-
source $BASH_ENV
59-
node --version
60-
- restore_cache:
61-
key: npm-cache-v2-{{ checksum "package-lock.json" }}
45+
sudo corepack enable
46+
sudo corepack prepare pnpm@latest-8 --activate
6247
- run:
6348
name: Install Dependencies
64-
command: npm ci
49+
command: pnpm install --no-frozen-lockfile
6550
- run:
6651
name: Chrome key start setup
6752
command: sudo apt update -y
@@ -72,26 +57,23 @@ jobs:
7257
name: Chrome package download
7358
command: sudo apt install ./google-chrome-stable_current_amd64.deb
7459
- save_cache:
75-
key: npm-cache-v1-{{ checksum "package-lock.json" }}
60+
key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }}
7661
paths:
77-
- /home/circleci/.npm
62+
- ~/.pnpm-store
7863
- store_artifacts:
7964
path: /root/.npm/_logs
8065
- run:
8166
name: Run Jest Tests
82-
command: npm test
67+
command: pnpm test
8368
- codecov/upload
8469
parallelism: 6
8570
workflows:
8671
chromatic-deploy:
8772
jobs:
8873
- build:
8974
name: Build Next.js project
90-
# - chromatic-deployment:
91-
# name: Check build with Chromatic
92-
- cypress-run-with-electron:
93-
name:
94-
Run Cypress E2E tests with Electron
95-
#cypress-command: npx cypress run --browser electron
96-
#start-command: npm run dev
97-
#parallelism: 8
75+
#- cypress/run:
76+
#name: Run Cypress E2E tests with Electron
77+
#cypress-command: npx cypress run --browser electron
78+
#start-command: pnpm run dev
79+
#parallelism: 8

.github/workflows/playwright.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ jobs:
99
timeout-minutes: 60
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
12+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
1313
- uses: actions/setup-node@v4
14+
- uses: pnpm/action-setup@v2
1415
with:
1516
node-version: 18
17+
cache: 'pnpm' # This will enable caching for pnpm
18+
version: 8
19+
- name: Install pnpm
20+
run: npm install -g pnpm
21+
- name: Verify pnpm installation
22+
run: pnpm --version
1623
- name: Install dependencies
17-
run: npm ci
24+
run: npx pnpm install --frozen-lockfile
1825
- name: Install Playwright Browsers
19-
run: npx playwright install --with-deps
26+
run: npx pnpm exec playwright install --with-deps
2027
- name: Run Playwright tests
21-
run: npx playwright test
28+
run: npx pnpm exec playwright test
2229
- uses: actions/upload-artifact@v4
2330
if: always()
2431
with:

next.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ const headers = [
3737
}
3838
];
3939

40-
const config = {
40+
const config = {
4141
reactStrictMode: true,
4242
poweredByHeader: false,
4343
images: {
4444
domains: ["cdn.sanity.io", "dfweb.no", "www.dfweb.no"],
45-
minimumCacheTTL: 600
45+
minimumCacheTTL: 800
4646
},
4747
i18n: {
4848
locales: ["nb-NO"],
4949
defaultLocale: "nb-NO"
5050
},
51-
async headers() {
51+
headers() {
5252
return [
5353
{
5454
source: "/(.*)",

0 commit comments

Comments
 (0)