generated from timelessco/react-components-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(perf): 👷 add perf improvements to ci builds
- Loading branch information
1 parent
1a8511e
commit bc6e02c
Showing
9 changed files
with
325 additions
and
114 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
install: | ||
name: Install node_modules | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache node_modules | ||
- uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn --prefer-offline --frozen-lockfile | ||
|
||
lint: | ||
name: Lint | ||
needs: install | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Cache node_modules | ||
- uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn --prefer-offline --frozen-lockfile | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
build: | ||
name: Build | ||
needs: install | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Cache node_modules | ||
- uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn --prefer-offline --frozen-lockfile | ||
|
||
- name: Built | ||
run: yarn build | ||
|
||
test: | ||
name: Test (${{ matrix.shard }}) | ||
needs: install | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shard: ["1/2", "2/2"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Cache node_modules | ||
- uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn --prefer-offline --frozen-lockfile | ||
|
||
- name: Test | ||
run: yarn test -- --maxWorkers 2 --shard ${{ matrix.shard }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ const config = { | |
}, | ||
}, | ||
}, | ||
"storybook-addon-turbo-build", | ||
], | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"git.branchProtection": ["main"], | ||
"yaml.schemas": { | ||
"https://json.schemastore.org/github-workflow.json": "file:///Users/navin/Documents/github/react-tailwind/.github/workflows/build.yml" | ||
} | ||
"editor.tabSize": 2, | ||
"editor.guides.bracketPairs": true, | ||
"editor.rulers": [80, 100, 120], | ||
"editor.wordWrap": "bounded", | ||
"editor.wordWrapColumn": 120, | ||
"files.insertFinalNewline": true, | ||
"files.trimTrailingWhitespace": true, | ||
"files.eol": "\n", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"prettier.enable": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.addMissingImports": true, | ||
// "source.organizeImports": true, | ||
// "source.sortImports": true, | ||
// "source.fixAll": true | ||
"source.fixAll.eslint": true | ||
// "source.fixAll.stylelint": true | ||
}, | ||
"eslint.enable": true, | ||
"eslint.useESLintClass": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"vue", | ||
"typescript", | ||
"typescriptreact", | ||
"html" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.