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

NEXT-33446 - pnpm #2

Merged
merged 38 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
34ad06e
NEXT-33446 - add basic CI pipeline
Haberkamp Feb 5, 2024
df4ab8c
NEXT-33446 - add command to check formatting
Haberkamp Feb 5, 2024
65c66bf
NEXT-33446 - check formatting in CI pipeline
Haberkamp Feb 5, 2024
e8cf63a
NEXT-33446 - rename script from test to test:unit
Haberkamp Feb 5, 2024
0c210f5
NEXT-33446 - add job for unit testing
Haberkamp Feb 5, 2024
bab63d2
NEXT-33446 - bump up node version to 20 in CI
Haberkamp Feb 5, 2024
ef8c8c9
NEXT-33446 - disable cache in ci
Haberkamp Feb 5, 2024
0390cf9
NEXT-33446 - run storybook tests in CI pipeline
Haberkamp Feb 5, 2024
b44efd7
NEXT-33446 - update path to node_modules folder
Haberkamp Feb 5, 2024
673a965
NEXT-33446 - update path to node_modules folder
Haberkamp Feb 5, 2024
d85f220
NEXT-33446 - add preview job
Haberkamp Feb 5, 2024
a4771fb
NEXT-33446 - comment out job for storybook tests
Haberkamp Feb 5, 2024
b0b9583
NEXT-33446 - add job for deploying preview
Haberkamp Feb 5, 2024
8b19e88
NEXT-33446 - add job for chromatic
Haberkamp Feb 5, 2024
5ffc9af
NEXT-33446 - add job publishing component library to npm
Haberkamp Feb 5, 2024
7fea251
NEXT-33446 - bump up node version for deploy-preview job
Haberkamp Feb 5, 2024
f00aced
NEXT-33446 - fix vue-template-compiler version mismatch
Haberkamp Feb 5, 2024
603e26a
NEXT-33446 - bump up actions/checkout version to v4
Haberkamp Feb 5, 2024
f81ad03
NEXT-33446 - remove unnecessary pull request configuration in test wo…
Haberkamp Feb 5, 2024
75c89c8
NEXT-33446 - run test workflow after merge on main branch
Haberkamp Feb 5, 2024
c116801
NEXT-33446 - bump up version of actions/setup-node to v4
Haberkamp Feb 5, 2024
8fee590
NEXT-33446 - enable node_modules caching
Haberkamp Feb 5, 2024
302b1e9
NEXT-33446 - remove .github directory in component-library
Haberkamp Feb 5, 2024
848a5a1
NEXT-33446 - move LICENSE.md file to root of project
Haberkamp Feb 5, 2024
07ea8a0
NEXT-33446 - add test:unit:watch command
Haberkamp Feb 5, 2024
0de89de
NEXT-33446 - fix lint:all command in root package.json
Haberkamp Feb 5, 2024
30279b8
NEXT-33446 - add build command to turbo
Haberkamp Feb 5, 2024
5bc4b18
NEXT-33446 - fix typo in comment
Haberkamp Feb 6, 2024
0158807
NEXT-33446 - move to pnpm
Haberkamp Feb 6, 2024
5bf3ebb
NEXT-33446 - disable cache
Haberkamp Feb 6, 2024
048a6e6
NEXT-33446 - use pnpm instead of pnpm in CI pipeline
Haberkamp Feb 6, 2024
a42065a
NEXT-33446 - format code
Haberkamp Feb 6, 2024
26e262d
NEXT-33446 - use npx instead of pnpm dlx for storybook visual tests
Haberkamp Feb 6, 2024
037b213
NEXT-33446 - set node version explicitly in CI pipeline
Haberkamp Feb 6, 2024
59d138c
NEXT-33446 - update snapshots
Haberkamp Feb 6, 2024
12b9970
NEXT-33446 - update docker command to include whole monorepo
Haberkamp Feb 6, 2024
0ac2a87
NEXT-33446 - only run visual tests on workflow dispatch
Haberkamp Feb 6, 2024
0581fd1
NEXT-33446 - add env variables required for turbos remote caching
Haberkamp Feb 6, 2024
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
34 changes: 34 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Chromatic'

on:
push:
branches:
- main

jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for the chromatic CLI to work

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm ci

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
zip: true
allowConsoleErrors: true
37 changes: 37 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deployment

on:
push:
branches:
- main

jobs:
create_storybook_pages:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm ci

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Deploy 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
force: false
branch: gh-pages
folder: storybook-static
clean-exclude: pr-preview/
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to NPM

on:
push:
branches:
- main

jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm ci

- name: Build distributed files
run: pnpm --prefix ./packages/component-library run build-vue
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: 'public'
38 changes: 38 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install main dependencies
run: pnpm install

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./packages/component-library/storybook-static/
67 changes: 67 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Tests

on:
pull_request:

push:
branches:
- main

workflow_dispatch:

jobs:
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm i

- name: Check formatting
run: pnpm run format:check

- name: Perform typecheck
run: pnpm run lint:types

- name: Lint code
run: pnpm run lint:eslint

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm install

- name: unit
run: pnpm run test:unit
53 changes: 53 additions & 0 deletions .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Visual tests

on:
push:
branches:
- main

workflow_dispatch:

jobs:
storybook-tests:
name: Storybook Tests
timeout-minutes: 60
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: pnpm install

- name: Install Playwright
run: pnpm dlx playwright install

- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook

- name: Run Tests
id: storybookTests
run: |
cd ./packages/component-library &&
npx concurrently --kill-others --success first --names "SB,TEST" --prefix-colors "magenta,blue" \
"http-server storybook-static -a 127.0.0.1 --port 6006" \
"wait-on http://127.0.0.1:6006 && pnpm run test-storybook"

- name: Archive visual test diffs
uses: actions/upload-artifact@v3
if: always()
with:
name: visual-test-diffs
path: ./packages/component-library/__snapshots__
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
File renamed without changes.
Loading
Loading