-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: impoves linting and testing in CI (#163)
* feat: adds eslint to as a github action * feat: setup cache for gh actions * fix: stylelint not finding any files * fix: commitlint * feat: adds css.js files to lint-staged * feat: adds snapshot testing to CI
- Loading branch information
Showing
16 changed files
with
125 additions
and
10,522 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -14,11 +14,32 @@ jobs: | |
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Get node version | ||
id: node | ||
run: | | ||
echo "::set-output name=version::$(node -v)" | ||
- name: Get node_modules cache | ||
uses: actions/[email protected] | ||
id: node_modules | ||
with: | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Generate tokens | ||
run: npm run tokens:generate | ||
- name: Commit changes | ||
|
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
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,19 +1,35 @@ | ||
# name: eslint | ||
name: eslint | ||
|
||
# on: [push, pull_request] | ||
on: [push, pull_request] | ||
|
||
# jobs: | ||
# eslint: | ||
# runs-on: ubuntu-latest | ||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Install dependencies | ||
# run: npm install | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
# - name: Eslint | ||
# uses: wagoid/eslint-pr-action@v1 | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# eslint_args: '--ext .js,.jsx,.ts,.tsx' | ||
- name: Get node version | ||
id: node | ||
run: | | ||
echo "::set-output name=version::$(node -v)" | ||
- name: Get node_modules cache | ||
uses: actions/[email protected] | ||
id: node_modules | ||
with: | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Run ESLint | ||
run: npm run lint |
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,35 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
snapshot-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Get node version | ||
id: node | ||
run: | | ||
echo "::set-output name=version::$(node -v)" | ||
- name: Get node_modules cache | ||
uses: actions/[email protected] | ||
id: node_modules | ||
with: | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Run Snapshot Tests | ||
run: npm run test |
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 @@ | ||
{ "packages/ui-library/**/*.{ts,tsx,js}": ["eslint --fix", "stylelint", "prettier --write"] } |
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
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
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
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
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
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.