Skip to content

Commit

Permalink
Updates to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthendren committed Oct 17, 2023
1 parent 6156730 commit 24b812b
Show file tree
Hide file tree
Showing 28 changed files with 127 additions and 211 deletions.
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": [
"@changesets/changelog-github",
{ "repo": "commitd/components" }
],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
8 changes: 4 additions & 4 deletions .changeset/stale-snails-greet.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
'@committed/eslint-config': minor
'@committed/ds-utilities': minor
'@committed/tsconfig': minor
'storybook': minor
'@committed/ds-tsconfig': minor
'@committed/ds-storybook': minor
'@committed/ds-colors': minor
'@committed/ds-tokens': minor
'example': minor
'@committed/ds-example': minor
'@committed/ds': minor
'@committed/ds-ss': minor
'next': minor
'@committed/ds-next': minor
---

Initial version of pandacss base committed components
6 changes: 1 addition & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node packages
RUN su node -c "npm install -g rimraf pnpm turbo ts-node"
RUN su node -c "npm install -g rimraf pnpm turbo"
RUN echo "alias pm=pnpm" >> /home/node/.bashrc
RUN echo "alias npm=pnpm" >> /home/node/.bashrc
RUN echo "alias px='pnpm dlx'" >> /home/node/.bashrc
RUN echo "alias npx='pnpm dlx'" >> /home/node/.bashrc
RUN echo "alias pm=pnpm" >> /home/node/.zshrc
RUN echo "alias npm=pnpm" >> /home/node/.zshrc
RUN echo "alias px='pnpm dlx'" >> /home/node/.zshrc
RUN echo "alias npx='pnpm dlx'" >> /home/node/.zshrc
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

"postCreateCommand": "pnpm setup ; pnpm dlx playwright install --with-deps ",
"postCreateCommand": "pnpm setup",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
Expand Down
165 changes: 23 additions & 142 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,172 +13,53 @@ concurrency:
cancel-in-progress: true

env:
CI: true
NODE_VERSION: 16
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
- name: Run build
run: |
pnpm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-output
path: dist
retention-days: 1
static-analysis:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: |
npm install
- name: Run prettier
run: |
npm run format:check
- name: Run lint
run: |
npm run lint
- name: Danger
if: github.event_name == 'pull_request'
run: npm run danger:pr -- ci
env:
PR: ${{ github.event.number }}
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit-test-scan:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v3
with:
fetch-depth: 0
- args: [--global, prettier, typescript, rimraf, turbo]
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: |
npm install
- name: Run tests
run: |
npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}
build-example:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-output
path: dist
- name: Install Dependencies
run: |
npm install
- name: Check example
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: Run build
run: |
npm run build
working-directory: ./example
build-storybook:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
pnpm run ci
- name: Setup git users
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
run: |
npm install
- name: Build Storybook
run: npm run build-storybook --quiet
release:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
runs-on: ubuntu-latest
needs: [static-analysis, unit-test-scan, build-example]
steps:
- name: Checkout Commit
uses: actions/checkout@v3
git config --global user.name "commitd-bot"
git config --global user.email "56758001+committed-bot@users.noreply.github.com"
- name: create and publish versions
uses: changesets/action@v1
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
with:
token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: |
npm install
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-output
path: dist
- name: Release
version: pnpm ci:version
setupGitUser: 'false'
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: commitd-bot
GIT_AUTHOR_EMAIL: 56758001+committed-bot@users.noreply.github.com
GIT_COMMITTER_NAME: commitd-bot
GIT_COMMITTER_EMAIL: 56758001+commitd-bot@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
publish-storybook:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout Commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: |
npm install
- name: Publish Storybook
if: github.ref == 'refs/heads/main'
run: npm run deploy-storybook -- --ci
if: github.ref == 'refs/heads/beta'
run: pnpm -f storybook run deploy-storybook -- --ci
env:
GH_TOKEN: commitd-bot:${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm build
pnpm test
pnpm lint
pnpm run ci
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages/ss
dist
.rpt2_cache
lib
Expand Down
4 changes: 2 additions & 2 deletions apps/example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "example",
"name": "@committed/ds-example",
"version": "0.0.0",
"private": true,
"scripts": {},
Expand All @@ -9,7 +9,7 @@
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@committed/eslint-config": "workspace:*",
"@committed/tsconfig": "workspace:*",
"@committed/ds-tsconfig": "workspace:*",
"typescript": "^5.1.6"
}
}
2 changes: 1 addition & 1 deletion apps/example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@committed/tsconfig/nextjs.json",
"extends": "@committed/ds-tsconfig/nextjs.json",
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
Expand Down
4 changes: 2 additions & 2 deletions apps/next/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "next",
"name": "@committed/ds-next",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -22,7 +22,7 @@
},
"devDependencies": {
"@committed/eslint-config": "workspace:*",
"@committed/tsconfig": "workspace:*",
"@committed/ds-tsconfig": "workspace:*",
"@pandacss/dev": "^0.15.4",
"@pandacss/types": "^0.15.4",
"@types/node": "^17.0.12",
Expand Down
2 changes: 1 addition & 1 deletion apps/next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@committed/tsconfig/nextjs.json",
"extends": "@committed/ds-tsconfig/nextjs.json",
"compilerOptions": {
"plugins": [{ "name": "next" }]
},
Expand Down
12 changes: 6 additions & 6 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "storybook",
"name": "@committed/ds-storybook",
"version": "0.0.0",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"postinstall": "pnpm dlx playwright@1.38.1 install --with-deps chromium",
"prepare": "pnpm codegen",
"codegen": "panda codegen",
"test": "pnpm dlx concurrently -k -s first -n 'SB,TEST' -c 'magenta,blue' 'pnpm dlx http-server storybook-static --port 6006 --silent' 'pnpm dlx wait-on tcp:6006 && pnpm test-storybook'",
"test:live": "test-storybook",
"dev": "rimraf .next && storybook dev -p 6006",
"build": "storybook build",
"serve": "serve storybook-static",
"debug": "panda debug -c ./panda.config.ts"
"debug": "panda debug -c ./panda.config.ts",
"deploy-storybook": "storybook-to-ghpages"
},
"keywords": [],
"dependencies": {
"@committed/ds": "workspace:*",
"@committed/ds-ss": "workspace:*",
Expand All @@ -31,7 +31,7 @@
},
"devDependencies": {
"@committed/eslint-config": "workspace:*",
"@committed/tsconfig": "workspace:*",
"@committed/ds-tsconfig": "workspace:*",
"@pandacss/dev": "^0.15.4",
"@pandacss/types": "^0.15.4",
"@storybook/addon-actions": "^7.4.5",
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@committed/tsconfig/storybook.json",
"extends": "@committed/ds-tsconfig/storybook.json",
"include": ["**/*.ts", "**/*.tsx", "panda.config.ts"],
"exclude": ["node_modules"]
}
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
"debug": "turbo run debug",
"lint": "turbo run lint",
"test": "turbo run test",
"format": "prettier --write '**/{*.js,*.ts,*.tsx,*.json,*.md,*.mdx}'"
"format": "prettier --write '**/{*.js,*.ts,*.tsx,*.json,*.md,*.mdx}'",
"format:check": "prettier -c '**/{*.js,*.ts,*.tsx,*.json,*.md,*.mdx}'",
"ci": "turbo run format:check build lint test",
"ci:publish": "pnpm publish -r",
"ci:version": "pnpm changeset version"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@committed/ds-tsconfig": "workspace:*",
"@committed/eslint-config": "workspace:*",
"@committed/tsconfig": "workspace:*",
"@turbo/gen": "^1.9.7",
"eslint": "^8.51.0",
"eslint-plugin-turbo": "^1.10.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/ds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@committed/eslint-config": "workspace:*",
"@committed/ds-ss": "workspace:*",
"@committed/tsconfig": "workspace:*",
"@committed/ds-tsconfig": "workspace:*",
"@pandacss/dev": "^0.15.4",
"@pandacss/types": "^0.15.4",
"@types/node": "^17.0.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/ds/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@committed/tsconfig/react-library.json",
"extends": "@committed/ds-tsconfig/react-library.json",
"include": ["**/*.ts", "**/*.tsx", "panda.config.ts", "../ss/index.mjs"],
"exclude": ["dist", "build", "node_modules"]
}
1 change: 0 additions & 1 deletion packages/ss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "This package is auto-generated by Panda CSS",
"version": "0.0.0",
"type": "module",
"private": true,
"devDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
Loading

0 comments on commit 24b812b

Please sign in to comment.