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

Commit e9f7272

Browse files
Merge pull request #8 from chakra-ui/develop
ci: setup workflows for github
2 parents 48c7dee + e70f92f commit e9f7272

File tree

10 files changed

+70
-8
lines changed

10 files changed

+70
-8
lines changed

.github/pr.yml renamed to .github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: yarn lint
3535

3636
- name: Build packages
37-
run: yarn build
37+
run: yarn build && yarn bootstrap
3838

3939
- name: Run tests
4040
run: yarn test

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Release
5+
6+
on:
7+
push:
8+
paths:
9+
- "packages/**"
10+
branches:
11+
- master
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@master
20+
with:
21+
# This makes Actions fetch all Git history
22+
# so that Changesets can generate changelogs with the correct commits
23+
fetch-depth: 0
24+
25+
- name: Use Node.js 12.x
26+
uses: actions/setup-node@master
27+
with:
28+
node-version: 12.x
29+
30+
- name: Install dependencies
31+
run: yarn install --frozen-lockfile && yarn bootstrap
32+
33+
34+
- name: Linting
35+
run: yarn lint
36+
37+
- name: Building packages
38+
run: yarn build && yarn bootstrap
39+
40+
- name: Testing components
41+
run: yarn test
42+
env:
43+
CI: true
44+
45+
# TODO: Uncomment when ready to start testing RCs
46+
47+
# - name: Setup CI Git User
48+
# run: |
49+
# git config --global user.name "codebender828"
50+
# git config --global user.email "[email protected]"
51+
52+
# - name: Publish packages
53+
# uses: changesets/action@master
54+
# with:
55+
# publish: yarn release
56+
# title: "chore(release): version packages"
57+
# commit: "chore(release): version packages"
58+
# env:
59+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

_templates/generator/component/test-file.test.ts.ejs.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
to: packages/<%=h.changeCase.paramCase(name)%>/tests/<%=h.changeCase.paramCase(name)%>.test.ts
33
---
4-
import { render } from '@chakra-ui/vue-test-utils'
4+
import { render } from '../../test-utils/src'
55
import <%= h.changeCase.pascalCase(name) %> from '../'
66

77

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
transformIgnorePatterns: ['/node_modules/(?!lodash.)'],
1111
moduleNameMapper: {
1212
'^@/(.*)$': '<rootDir>/$1',
13+
'@chakra-ui/vue-test-utils': '<rootDir>/packages/test-utils/src/index.ts',
1314
},
1415
snapshotSerializers: [
1516
'@chakra-ui/vue-test-utils/dist/cjs/snapshot-serializer.js',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"packages/*"
1010
],
1111
"scripts": {
12-
"postinstall": "yarn run lerna bootstrap",
12+
"postinstall": "yarn bootstrap",
13+
"bootstrap": "yarn run lerna bootstrap",
1314
"scaffold": "hygen",
1415
"build": "lerna run build --no-private --stream",
1516
"dev": "yarn playground:routes && NODE_ENV=development vite serve playground --config ./vite.config.ts",

packages/c-accordion/tests/c-accordion.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render } from '@chakra-ui/vue-test-utils'
1+
import { render } from '../../test-utils/src'
22
import CAccordion from '../src'
33

44
it('should render properly', () => {

packages/c-alert/tests/c-alert.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render } from '@chakra-ui/vue-test-utils'
1+
import { render } from '../../test-utils/src'
22
import { CAlert } from '../src'
33

44
describe('Alert tests', () => {

packages/c-button/tests/c-button.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render } from '@chakra-ui/vue-test-utils'
1+
import { render } from '../../test-utils/src'
22
import CButton from '../src'
33

44
it('should render properly', () => {

packages/c-theme-provider/tests/c-theme-provider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ThemeProviderProps } from '@chakra-ui/vue-next/src'
2-
import { render, screen } from '@chakra-ui/vue-test-utils'
2+
import { render, screen } from '../../test-utils/src'
33
import { defineComponent, h, inject } from 'vue'
44
import CThemeProvider from '../src'
55

packages/system/tests/system.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, screen } from '@chakra-ui/vue-test-utils'
1+
import { render, screen } from '../../test-utils/src'
22
import { defineComponent, h } from 'vue'
33
import { chakra } from '../src'
44

0 commit comments

Comments
 (0)