-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: optimize workflows and test commands (#124)
* ci: optimize workflows and test commands * ci: fix optimized workflow * ci: fix optimized workflow 2 * ci: fix optimized workflow 3 * ci: dummy change to test caching * ci: fix optimized workflow 4 * ci: fix optimized workflow 5 * ci: fix optimized workflow 6 * ci: fix optimized workflow 7 * chore: change package.json version * ci: add names to check jobs
- Loading branch information
Showing
3 changed files
with
52 additions
and
72 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 |
---|---|---|
@@ -1,86 +1,65 @@ | ||
# .github/workflows/code-health.yml | ||
name: Code Health Checks | ||
|
||
name: Code health checks # name of the action (displayed in the github interface) | ||
|
||
on: # event list | ||
pull_request: # on a pull request to each of these branches | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: # environment variables (available in any part of the action) | ||
env: | ||
NODE_VERSION: 20 | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | ||
|
||
jobs: # list of things to do | ||
typecheck: | ||
name: Type Check # job name (unique id) | ||
runs-on: ubuntu-latest # on which machine to run | ||
steps: # list of steps | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
|
||
- name: Type Checking | ||
run: yarn typecheck | ||
|
||
linting: | ||
name: Linting # job name (unique id) | ||
runs-on: ubuntu-latest # on which machine to run | ||
steps: # list of steps | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
|
||
- name: Code Linting | ||
run: yarn eslint:check | ||
|
||
formatting: | ||
name: Formatting # job name (unique id) | ||
runs-on: ubuntu-latest # on which machine to run | ||
steps: # list of steps | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v2 | ||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v2 | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
|
||
- name: Code Formatting | ||
run: yarn prettier:check | ||
|
||
testing: | ||
name: Testing # job name (unique id) | ||
runs-on: ubuntu-latest # on which machine to run | ||
steps: # list of steps | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v2 | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn install --frozen-lockfile | ||
|
||
checks: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
check: | ||
- name: Typecheck | ||
command: typecheck | ||
- name: Lint | ||
command: eslint:check | ||
- name: Formatting | ||
command: prettier:check | ||
- name: Unit Tests | ||
command: test | ||
fail-fast: false | ||
name: ${{ matrix.check.name }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Restore node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Unit Tests | ||
run: yarn test | ||
- run: yarn ${{ matrix.check.command }} |
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,6 +1,6 @@ | ||
{ | ||
"name": "habitrack", | ||
"version": "1.0.0", | ||
"version": "0.1.0", | ||
"author": "Dominik Hryshaiev <[email protected]>", | ||
"type": "module", | ||
"repository": { | ||
|
@@ -14,6 +14,7 @@ | |
"react", | ||
"typescript", | ||
"vite", | ||
"zustand", | ||
"eslint", | ||
"prettier", | ||
"react-aria", | ||
|
@@ -34,7 +35,7 @@ | |
"eslint:fix": "eslint --fix .", | ||
"prettier:check": "prettier --check .", | ||
"prettier:write": "prettier --write .", | ||
"test": "DEBUG_PRINT_LIMIT=30000 jest --runInBand --config tests/jest.config.js --no-cache", | ||
"test": "DEBUG_PRINT_LIMIT=30000 jest --config tests/jest.config.js", | ||
"test:watch": "yarn test --watch", | ||
"test:coverage": "yarn test --coverage", | ||
"test:clear-cache": "jest --clearCache", | ||
|