Skip to content

Commit 35cc775

Browse files
feat(init): scaffold project
0 parents  commit 35cc775

40 files changed

Lines changed: 18979 additions & 0 deletions
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: build-lint-test
2+
on:
3+
workflow_call:
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
GH_PR_NUM: ${{ github.event.number }}
9+
steps:
10+
- uses: actions/checkout@v4
11+
- run: |
12+
if [[ ! -z "${GH_PR_NUM}" ]]; then
13+
echo "Checking out PR"
14+
git fetch origin pull/$GH_PR_NUM/head:tmp
15+
git checkout tmp
16+
fi
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
- name: Enable Corepack
21+
shell: bash
22+
run: corepack enable
23+
- uses: actions/cache@v4
24+
id: yarn-cache
25+
name: Cache npm deps
26+
with:
27+
path: |
28+
node_modules
29+
**/node_modules
30+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
31+
- run: yarn install --immutable
32+
if: steps.yarn-cache.outputs.cache-hit != 'true'
33+
- uses: actions/cache@v4
34+
id: dist
35+
name: Cache dist
36+
with:
37+
path: |
38+
packages/*/dist
39+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
40+
- name: Build dist
41+
run: yarn build
42+
if: steps.dist.outputs.cache-hit != 'true'
43+
lint:
44+
runs-on: ubuntu-latest
45+
env:
46+
GH_PR_NUM: ${{ github.event.number }}
47+
needs: build
48+
steps:
49+
- uses: actions/checkout@v4
50+
- run: |
51+
if [[ ! -z "${GH_PR_NUM}" ]]; then
52+
echo "Checking out PR"
53+
git fetch origin pull/$GH_PR_NUM/head:tmp
54+
git checkout tmp
55+
fi
56+
- uses: actions/setup-node@v4
57+
with:
58+
node-version: '20'
59+
- name: Enable Corepack
60+
shell: bash
61+
run: corepack enable
62+
- uses: actions/cache@v4
63+
id: yarn-cache
64+
name: Cache npm deps
65+
with:
66+
path: |
67+
node_modules
68+
**/node_modules
69+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
70+
- run: yarn install --immutable
71+
if: steps.yarn-cache.outputs.cache-hit != 'true'
72+
- uses: actions/cache@v4
73+
id: lint-cache
74+
name: Load lint cache
75+
with:
76+
path: '.eslintcache'
77+
key: ${{ runner.os }}-lint-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
78+
- name: Enable Corepack
79+
shell: bash
80+
run: corepack enable
81+
- name: ESLint
82+
run: yarn lint:js
83+
- name: MDLint
84+
run: yarn lint:md
85+
test_jest:
86+
runs-on: ubuntu-latest
87+
env:
88+
GH_PR_NUM: ${{ github.event.number }}
89+
needs: build
90+
steps:
91+
- uses: actions/checkout@v4
92+
# Yes, we really want to checkout the PR
93+
- run: |
94+
if [[ ! -z "${GH_PR_NUM}" ]]; then
95+
echo "Checking out PR"
96+
git fetch origin pull/$GH_PR_NUM/head:tmp
97+
git checkout tmp
98+
fi
99+
- uses: actions/setup-node@v4
100+
with:
101+
node-version: '20'
102+
- name: Enable Corepack
103+
shell: bash
104+
run: corepack enable
105+
- uses: actions/cache@v4
106+
id: yarn-cache
107+
name: Cache npm deps
108+
with:
109+
path: |
110+
node_modules
111+
**/node_modules
112+
~/.cache/Cypress
113+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
114+
- run: yarn install --immutable
115+
if: steps.yarn-cache.outputs.cache-hit != 'true'
116+
- uses: actions/cache@v4
117+
id: dist
118+
name: Cache dist
119+
with:
120+
path: |
121+
packages/*/dist
122+
packages/react-styles/css
123+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
124+
- name: Build dist
125+
run: yarn build
126+
if: steps.dist.outputs.cache-hit != 'true'
127+
- name: PF6 Jest Tests
128+
run: yarn test --maxWorkers=2
129+
test_a11y:
130+
runs-on: ubuntu-latest
131+
env:
132+
GH_PR_NUM: ${{ github.event.number }}
133+
needs: build
134+
steps:
135+
- uses: actions/checkout@v4
136+
# Yes, we really want to checkout the PR
137+
- run: |
138+
if [[ ! -z "${GH_PR_NUM}" ]]; then
139+
echo "Checking out PR"
140+
git fetch origin pull/$GH_PR_NUM/head:tmp
141+
git checkout tmp
142+
fi
143+
- uses: actions/setup-node@v4
144+
with:
145+
node-version: '20'
146+
- name: Enable Corepack
147+
shell: bash
148+
run: corepack enable
149+
- uses: actions/cache@v4
150+
id: yarn-cache
151+
name: Cache npm deps
152+
with:
153+
path: |
154+
node_modules
155+
**/node_modules
156+
~/.cache/Cypress
157+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
158+
- run: yarn install --immutable
159+
if: steps.yarn-cache.outputs.cache-hit != 'true'
160+
- uses: actions/cache@v4
161+
id: dist
162+
name: Cache dist
163+
with:
164+
path: |
165+
packages/*/dist
166+
packages/react-styles/css
167+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
168+
- name: Build dist
169+
run: yarn build
170+
if: steps.dist.outputs.cache-hit != 'true'
171+
- name: Build docs
172+
run: yarn build:docs
173+
- name: A11y tests
174+
run: yarn serve:docs & yarn test:a11y

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: build
2+
on:
3+
workflow_call:
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
GH_PR_NUM: ${{ github.event.number }}
9+
steps:
10+
- uses: actions/checkout@v4
11+
- run: |
12+
if [[ ! -z "${GH_PR_NUM}" ]]; then
13+
echo "Checking out PR"
14+
git fetch origin pull/$GH_PR_NUM/head:tmp
15+
git checkout tmp
16+
fi
17+
- uses: actions/cache@v4
18+
id: setup-cache
19+
name: Cache setup
20+
with:
21+
path: |
22+
README.md
23+
package.json
24+
.tmplr.yml
25+
packages/*/package.json
26+
packages/*/patternfly-docs/content/**
27+
packages/*/patternfly-docs/generated/**
28+
key: ${{ runner.os }}-setup-15-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package.json', 'packages/module/package.json') }}
29+
- name: Run build script
30+
run: ./devSetup.sh
31+
shell: bash
32+
if: steps.setup-cache.outputs.cache-hit != 'true'
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
- name: Enable Corepack
37+
shell: bash
38+
run: corepack enable
39+
- uses: actions/cache@v4
40+
id: yarn-cache
41+
name: Cache npm deps
42+
with:
43+
path: |
44+
node_modules
45+
**/node_modules
46+
key: ${{ runner.os }}-yarn-15-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
47+
- run: yarn install --immutable
48+
if: steps.yarn-cache.outputs.cache-hit != 'true'
49+
- uses: actions/cache@v4
50+
id: dist
51+
name: Cache dist
52+
with:
53+
path: |
54+
packages/*/dist
55+
key: ${{ runner.os }}-dist-15-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
56+
- name: Build dist
57+
run: yarn build
58+
if: steps.dist.outputs.cache-hit != 'true'

.github/workflows/check-pr.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: check-pr
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
call-build-lint-test-workflow:
8+
uses: ./.github/workflows/build-lint-test.yml

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
call-build-lint-test-workflow:
8+
uses: ./.github/workflows/build-lint-test.yml
9+
deploy:
10+
runs-on: ubuntu-latest
11+
needs: [call-build-lint-test-workflow]
12+
env:
13+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
- name: Enable Corepack
21+
shell: bash
22+
run: corepack enable
23+
- uses: actions/cache@v4
24+
id: yarn-cache
25+
name: Cache npm deps
26+
with:
27+
path: |
28+
node_modules
29+
**/node_modules
30+
~/.cache/Cypress
31+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
32+
- run: yarn install --immutable
33+
if: steps.yarn-cache.outputs.cache-hit != 'true'
34+
- uses: actions/cache@v4
35+
id: dist
36+
name: Cache dist
37+
with:
38+
path: |
39+
packages/*/dist
40+
packages/react-styles/css
41+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
42+
- name: Build dist
43+
run: yarn build
44+
if: steps.dist.outputs.cache-hit != 'true'
45+
- name: Release to NPM
46+
run: cd packages/module && npx semantic-release@19.0.5

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Javascript builds
2+
node_modules
3+
dist
4+
tsc_out
5+
.out
6+
.changelog
7+
.DS_Store
8+
coverage
9+
.cache
10+
.tmp
11+
.eslintcache
12+
13+
# package managers
14+
yarn-error.log
15+
lerna-debug.log
16+
17+
# IDEs and editors
18+
.idea
19+
.project
20+
.classpath
21+
.c9
22+
*.launch
23+
.settings
24+
*.sublime-workspace
25+
.history
26+
.vscode
27+
.yo-rc.json
28+
29+
# IDE - VSCode
30+
.vscode
31+
# For vim
32+
*.swp
33+
34+
public
35+
36+
.yarn

.prettierignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Javascript builds
2+
node_modules
3+
dist
4+
tsc_out
5+
.out
6+
.changelog
7+
.DS_Store
8+
coverage
9+
.cache
10+
.tmp
11+
.eslintcache
12+
generated
13+
14+
# package managers
15+
yarn-error.log
16+
lerna-debug.log
17+
18+
# IDEs and editors
19+
.idea
20+
.project
21+
.classpath
22+
.c9
23+
*.launch
24+
.settings
25+
*.sublime-workspace
26+
.history
27+
.vscode
28+
.yo-rc.json
29+
30+
# IDE - VSCode
31+
.vscode
32+
# For vim
33+
*.swp
34+
35+
public

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "none",
6+
"useTabs": false,
7+
"printWidth": 120
8+
}

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Red Hat, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)