-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Kleostro/chore/tu-01-01/update-ci-processes
chore(tu-01-01): update ci processes
- Loading branch information
Showing
10 changed files
with
277 additions
and
18 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,47 @@ | ||
documentation: | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.md' | ||
|
||
chore: | ||
- any: | ||
- changed-files: | ||
- any-glob-to-all-files: '*' | ||
- head-branch: | ||
- '^chore' | ||
|
||
feature: | ||
- head-branch: | ||
- '^feat' | ||
|
||
fix: | ||
- head-branch: | ||
- '^fix' | ||
- '^hotfix' | ||
|
||
refactor: | ||
- head-branch: | ||
- '^refactor' | ||
|
||
test: | ||
- any: | ||
- head-branch: | ||
- '^test' | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.spec.ts' | ||
|
||
revert: | ||
- head-branch: | ||
- '^revert' | ||
|
||
styles: | ||
- changed-files: | ||
- any-glob-to-any-file: '**/*.scss' | ||
|
||
sprint1: | ||
- head-branch: 'tu-01' | ||
|
||
sprint2: | ||
- head-branch: 'tu-02' | ||
|
||
sprint3: | ||
- head-branch: 'tu-03' |
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,54 @@ | ||
## PR Title ✨ | ||
|
||
📍 conforms with the following format: | ||
|
||
- [ ] prefix (following the [convention](https://www.conventionalcommits.org/en/v1.0.0-beta.2/): `feat`, `fix`, `hotfix`, `chore`, `refactor`, `revert`, `docs`, `style`, `test`) | ||
- [ ] sprint and issue number (e.g. `tu-01-02`, where `01` - is the sprint number and `02` - is the issue number) | ||
- [ ] short description | ||
|
||
👀 Example: `feat(tu-01-02): description` | ||
|
||
## PR Description 🧙♂️ | ||
|
||
_Add a comprehensive description of the changes in the PR_ 🤔 | ||
|
||
#### Affected Scope 💡 | ||
|
||
Provide affected modules or areas | ||
|
||
#### Styles 🎨 | ||
|
||
Provide any style changes details | ||
|
||
#### Testing Strategy 🧼 | ||
|
||
Describe the testing strategy for the changes | ||
|
||
#### Screenshots/Demo 📸 | ||
|
||
If necessary provide screenshots or a demo link to visually demonstrate the changes | ||
|
||
#### Documentation Updates 📖 | ||
|
||
Specify if any documentation updates are required and provide details on what needs to be updated | ||
|
||
#### Provide any other relevant information 🦉 | ||
|
||
## Auto-Review 🤖 | ||
|
||
- [x] The reviewers have been requested 📝 | ||
[![Request Review on PR Open](https://github.com/kleostro/tu-tu/actions/workflows/request_review.yml/badge.svg)](https://github.com/kleostro/tu-tu/actions/workflows/request_review.yml) | ||
- [x] The labels have been added 🎨 | ||
[![Pull Request Labeler](https://github.com/kleostro/tu-tu/actions/workflows/labeler.yml/badge.svg)](https://github.com/kleostro/tu-tu/actions/workflows/labeler.yml) | ||
- [x] My code doesn't generate any errors or warnings ⛓️ | ||
[![Continuous Integration](https://github.com/kleostro/tu-tu/actions/workflows/ci.yml/badge.svg)](https://github.com/kleostro/tu-tu/actions/workflows/ci.yml) | ||
- [x] My code builds successfully ⚙️ | ||
[![Netlify Status](https://api.netlify.com/api/v1/badges/9704b9db-b410-40b1-8d2b-2eeed828626e/deploy-status)](https://app.netlify.com/sites/mad-wizards-tu-tu/deploys) | ||
|
||
## Self-Check 🌟 | ||
|
||
- [ ] I wrote the correct title for the PR 🗝️ | ||
- [ ] I wrote a comprehensive description for the PR 📜 | ||
- [ ] I have performed a self-review of my own code ✅ | ||
- [ ] I have commented my code where needed 📝 | ||
- [ ] I am happy with my PR and ready to merge ❤️🔥 |
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,45 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- sprint-1 | ||
- sprint-2 | ||
- sprint-3 | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Format code with Prettier | ||
run: npm run ci:format | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Karma tests | ||
run: npm 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,18 @@ | ||
name: 'Pull Request Labeler' | ||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
labeler: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Label Pull Request | ||
uses: actions/labeler@v5 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,52 @@ | ||
name: Request Review on PR Open | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
automate-review: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get PR Author | ||
id: pr_author | ||
run: echo "::set-output name=author::${{ github.event.pull_request.user.login }}" | ||
|
||
- name: Request Review | ||
if: steps.pr_author.outputs.author == 'stardustmeg' | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers | ||
mediaType: '{"previews":["luke-cage"]}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
reviewers: '["Kleostro", "ki8vi", "katyastan"]' | ||
|
||
- name: Request Review | ||
if: steps.pr_author.outputs.author == 'Kleostro' | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers | ||
mediaType: '{"previews":["luke-cage"]}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
reviewers: '["stardustmeg", "ki8vi", "katyastan"]' | ||
|
||
- name: Request Review | ||
if: steps.pr_author.outputs.author == 'ki8vi' | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers | ||
mediaType: '{"previews":["luke-cage"]}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
reviewers: '["stardustmeg", "Kleostro", "katyastan"]' | ||
|
||
- name: Request Review | ||
if: steps.pr_author.outputs.author == 'katyastan' | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers | ||
mediaType: '{"previews":["luke-cage"]}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
reviewers: '["stardustmeg", "Kleostro", "ki8vi"]' |
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 +1,32 @@ | ||
npx lint-staged | ||
#!/bin/bash | ||
|
||
BASIC_RED="\e[0;31m" | ||
BASIC_GREEN="\e[0;32m" | ||
BASIC_BLUE="\e[0;34m" | ||
BASIC_CYAN="\e[0;36m" | ||
ENDCOLOR="\e[0m" | ||
|
||
run_linter () { | ||
echo -e "${BASIC_CYAN}Checking for linting errors in the src directory${ENDCOLOR}" | ||
npx lint-staged | ||
if [[ $? -ne 0 ]] | ||
then | ||
echo -e "${BASIC_RED}Linting failed. Please fix the errors and try again.${ENDCOLOR}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
run_tsc () { | ||
echo -e "${BASIC_BLUE}Checking for TypeScript errors${ENDCOLOR}" | ||
npx tsc | ||
if [[ $? -ne 0 ]] | ||
then | ||
echo -e "${BASIC_RED}TypeScript compilation failed. Please fix the errors and try again.${ENDCOLOR}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
run_linter | ||
run_tsc | ||
|
||
printf "${BASIC_GREEN} ✔ All checks passed. Happy coding${ENDCOLOR}!\n" |
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 @@ | ||
npx validate-branch-name |
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,5 +1,5 @@ | ||
{ | ||
"*": ["prettier --write --ignore-unknown"], | ||
"*.{cjs,js,mjs,jsx,ts,tsx}": ["eslint --max-warnings 0"], | ||
"*.{js,mjs,jsx,ts,tsx}": ["eslint --max-warnings 0"], | ||
"*.scss": "npx stylelint --fix" | ||
} |
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,9 @@ | ||
module.exports = { | ||
pattern: /^(feat|fix|hotfix|chore|refactor|revert|docs|style|test|)\/tu-0[1-3]-\d{2}\/[a-zA-Z0-9-]+$/, | ||
errorMsg: 'Please use correct branch name', | ||
}; | ||
|
||
// Branch Name Examples: | ||
|
||
// "feat/tu-01-01/add-login-form" // where 01 is the sprint number and 01 is the issue number | ||
// "fix/tu-02-03/fix-router" // where 02 is the sprint number and 03 is the issue number |
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