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

Commit

Permalink
Merge pull request #1610 from w3bdesign/1608-pnpm
Browse files Browse the repository at this point in the history
1608 pnpm
  • Loading branch information
w3bdesign authored Mar 6, 2024
2 parents 861c963 + 83aa5e7 commit 755c21e
Show file tree
Hide file tree
Showing 5 changed files with 15,977 additions and 25,520 deletions.
84 changes: 33 additions & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,52 @@
version: 2.1
orbs:
cypress: cypress-io/[email protected]
codecov: codecov/codecov@4.0.1
codecov: codecov/codecov@3.3.0
executors:
with-chrome-and-firefox:
docker:
- image: "cypress/browsers:node-20.10.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1"
- image: "cypress/browsers:node16.14.2-slim-chrome100-ff99-edge"
resource_class: large
jobs:
cypress-run-with-electron:
executor: with-chrome-and-firefox
steps:
- checkout
- run: npm install
- save_cache:
key: v1-dependenciesx-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Start Dev Server
command: npm run dev
background: true
- run:
name: Run Cypress E2E tests with Electron
command: |
npx cypress run --browser electron
chromatic-deployment:
docker:
- image: cimg/node:21.6.2
- image: cimg/node:21.5.0
working_directory: ~/chromatic
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-cache
- run: yarn install
- run: yarn chromatic --project-token=${CHROMATIC_PROJECT_TOKEN}
- pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }}
- pnpm-packages-cache-v1
- run:
name: Install pnpm package manager
command: |
sudo corepack enable
sudo corepack prepare pnpm@latest-8 --activate
- run:
name: Install Dependencies
command: pnpm install --frozen-lockfile
- run: pnpm run chromatic -- --project-token=${CHROMATIC_PROJECT_TOKEN}
- save_cache:
key: pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }}
paths:
- ~/.pnpm-store
build:
working_directory: /home/circleci/dfweb
docker:
- image: cimg/base:stable
- image: cimg/node:21.5.0-browsers
steps:
- checkout
- restore_cache:
key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }}
- run:
name: Install NVM and Node.js
command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
source $BASH_ENV
nvm install 18.17.0
- run:
name: Verify Node.js version
name: Install pnpm package manager
command: |
source $BASH_ENV
node --version
- restore_cache:
key: npm-cache-v2-{{ checksum "package-lock.json" }}
sudo corepack enable
sudo corepack prepare pnpm@latest-8 --activate
- run:
name: Install Dependencies
command: npm ci
command: pnpm install --no-frozen-lockfile
- run:
name: Chrome key start setup
command: sudo apt update -y
Expand All @@ -72,26 +57,23 @@ jobs:
name: Chrome package download
command: sudo apt install ./google-chrome-stable_current_amd64.deb
- save_cache:
key: npm-cache-v1-{{ checksum "package-lock.json" }}
key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }}
paths:
- /home/circleci/.npm
- ~/.pnpm-store
- store_artifacts:
path: /root/.npm/_logs
- run:
name: Run Jest Tests
command: npm test
command: pnpm test
- codecov/upload
parallelism: 6
workflows:
chromatic-deploy:
jobs:
- build:
name: Build Next.js project
# - chromatic-deployment:
# name: Check build with Chromatic
- cypress-run-with-electron:
name:
Run Cypress E2E tests with Electron
#cypress-command: npx cypress run --browser electron
#start-command: npm run dev
#parallelism: 8
#- cypress/run:
#name: Run Cypress E2E tests with Electron
#cypress-command: npx cypress run --browser electron
#start-command: pnpm run dev
#parallelism: 8
15 changes: 11 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
node-version: 18
cache: 'pnpm' # This will enable caching for pnpm
version: 8
- name: Install pnpm
run: npm install -g pnpm
- name: Verify pnpm installation
run: pnpm --version
- name: Install dependencies
run: npm ci
run: npx pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: npx pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
run: npx pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
6 changes: 3 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ const headers = [
}
];

const config = {
const config = {
reactStrictMode: true,
poweredByHeader: false,
images: {
domains: ["cdn.sanity.io", "dfweb.no", "www.dfweb.no"],
minimumCacheTTL: 600
minimumCacheTTL: 800
},
i18n: {
locales: ["nb-NO"],
defaultLocale: "nb-NO"
},
async headers() {
headers() {
return [
{
source: "/(.*)",
Expand Down
Loading

0 comments on commit 755c21e

Please sign in to comment.