-
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: setup CI pipeline and fix some issues (#35)
This pull request includes several important changes to configuration files, workflows, and code refactoring for better consistency and performance. The most significant changes involve updates to `.editorconfig`, `.eslintrc.json`, and various code refactorings to improve the maintainability and readability of the codebase. ### Configuration Updates: * **`.editorconfig`**: Added rules for indentation, charset, and trimming of trailing whitespace to ensure consistent coding styles across different editors. * **`.eslintrc.json`**: Extended ESLint configuration to include TypeScript rules and added **temporary exceptions** for TypeScript-specific linting rules that will need to be addressed in future updates. * **`.npmrc`**: Ensured exact versions are installed and disabled caching of side effects to avoid issues with post-install scripts. * **`.nvmrc`**: Specified Node.js version 22. ### Workflow Enhancements: * **CI Workflow**: Added a new Continuous Integration workflow to automate setup, formatting checks, and linting. * **Docker Workflow**: Enhanced the workflow to handle manual releases and added a condition to build and push Docker images only for specific repository and commit messages. ### Code Refactoring: * **Fixed Lint Issues**: Replaced `let` with `const` for variables that are not reassigned to improve code readability and maintainability. Changes were applied in multiple files across the codebase. ### Additional Changes: * **VSCode Settings**: Updated VSCode settings to organize imports and fix all issues on save using Biome. * **Biome Configuration**: Updated `biome.json` to ignore additional directories and use `.editorconfig` settings. * **Lefthook Configuration**: Modified `lefthook.yml` to run specific checks and audits during pre-commit and pre-push hooks. * **Package Management**: Updated `package.json` and `pnpm-lock.yaml` to ensure specific versions of dependencies and tools are used.
- Loading branch information
Showing
18 changed files
with
179 additions
and
41 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{Makefile,**.mk}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false | ||
|
||
[docker-compose{,.*}.{yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 |
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,25 @@ | ||
{ | ||
"extends": ["next", "next/core-web-vitals", "plugin:unicorn/recommended"], | ||
"extends": [ | ||
"next", | ||
"next/core-web-vitals", | ||
"next/typescript", | ||
"plugin:unicorn/recommended" | ||
], | ||
"plugins": ["filenames"], | ||
"ignorePatterns": ["next-env.d.ts"], | ||
"rules": { | ||
"filenames/match-regex": ["error", "^[a-z0-9-]+$", true], | ||
"unicorn/filename-case": [ | ||
"error", | ||
{ | ||
"case": "kebabCase" | ||
} | ||
], | ||
"unicorn/filename-case": ["error", { "case": "kebabCase" }], | ||
"unicorn/no-null": 0, | ||
"unicorn/no-array-for-each": 0, | ||
"unicorn/no-nested-ternary": 0, | ||
"unicorn/prefer-spread": 0, | ||
"unicorn/prevent-abbreviations": 0 | ||
"unicorn/prevent-abbreviations": 0, | ||
// TODO: Check these rules later | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-unused-vars": [ | ||
0, | ||
{ "argsIgnorePattern": "^_", "args": "all" } | ||
] | ||
} | ||
} |
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,75 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
setup: | ||
name: Setup NodeJs, PNPM and Cache | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
- name: Install Pnpm | ||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | ||
with: | ||
run_install: false | ||
- name: Install Node.js | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 22 | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
format: | ||
name: FORMAT - Run Biome Check | ||
runs-on: ubuntu-24.04 | ||
needs: [setup] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
- name: Install Pnpm | ||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | ||
with: | ||
run_install: false | ||
- name: Install Node.js | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 22 | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Check lint | ||
run: pnpm run check:ci | ||
lint: | ||
name: LINT - Run Next Lint | ||
runs-on: ubuntu-24.04 | ||
needs: [setup] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
- name: Install Pnpm | ||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | ||
with: | ||
run_install: false | ||
- name: Install Node.js | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 22 | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Check lint | ||
run: pnpm 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
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,6 @@ | ||
# Ensures exact versions are installed and saved in package.json | ||
save-exact=true | ||
|
||
# Disables caching of side effects to avoid issues with post-install scripts | ||
# See https://github.com/evilmartians/lefthook/blob/1c92f5b80de7a210e4cd4c7fe1b29a0e9df8ddd3/docs/install.md?plain=1#L61 | ||
side-effects-cache=false |
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 @@ | ||
22 |
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,4 +1,8 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "biomejs.biome" | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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.