diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d81ae6..06e3e25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,3 +35,12 @@ jobs: - name: 🏗️ Build the project run: npm run build:ts + + - name: 🧪 Run tests + run: npm test + + - name: 🧹 Lint the code + run: npm run lint + + - name: 📊 Generate code coverage reports + run: npm run coverage diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 31e24d7..72082ac 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -46,10 +46,18 @@ jobs: npm install -D dmg-license -f npm install electron-builder -g - - name: ⚙️ Install additional tools (linux , win) if: matrix.os != 'macOS-latest' run: npm install electron-builder -g - name: 🏗️ Build the project - run: npm run build \ No newline at end of file + run: npm run build + + - name: 🧪 Run tests + run: npm test + + - name: 🧹 Lint the code + run: npm run lint + + - name: 📊 Generate code coverage reports + run: npm run coverage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b39b958..9090038 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,10 +25,20 @@ jobs: - name: Install electron-builder run: npm i electron-builder -g + - name: 🧪 Run tests + run: npm test + + - name: 🧹 Lint the code + run: npm run lint + + - name: 📊 Generate code coverage reports + run: npm run coverage + - name: Publish env: GH_TOKEN: ${{ secrets.TOKEN }} run: npm run publish:linux + publish_on_win: runs-on: windows-latest steps: @@ -47,46 +57,75 @@ jobs: - name: Install electron-builder run: npm i electron-builder -g + - name: 🧪 Run tests + run: npm test + + - name: 🧹 Lint the code + run: npm run lint + + - name: 📊 Generate code coverage reports + run: npm run coverage + - name: Publish env: GH_TOKEN: ${{ secrets.TOKEN }} run: npm run publish:win + publish_on_macos: runs-on: macOS-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Install Node v20 - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: npm + - name: Install Node v20 + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm - - name: Install Python - run: brew install python@3.11 + - name: Install Python + run: brew install python@3.11 - - name: "Install Python setuptools" - run: brew install python-setuptools + - name: "Install Python setuptools" + run: brew install python-setuptools - - name: Install Build Tools - run: | - brew install libtool automake autoconf - sudo xcode-select --reset + - name: Install Build Tools + run: | + brew install libtool automake autoconf + sudo xcode-select --reset - - name: Update node-gyp - run: npm install -g node-gyp + - name: Update node-gyp + run: npm install -g node-gyp - - name: Install dependencies - run: npm install + - name: Install dependencies + run: npm install + + - name: Install dmglicense + run: npm install dmg-license -f + + - name: Install electron-builder + run: npm i electron-builder -g + + - name: 🧪 Run tests + run: npm test - - name: Install dmglicense - run: npm install dmg-license -f + - name: 🧹 Lint the code + run: npm run lint - - name: Install electron-builder - run: npm i electron-builder -g + - name: 📊 Generate code coverage reports + run: npm run coverage + + - name: Publish + env: + GH_TOKEN: ${{ secrets.TOKEN }} + run: npm run publish:mac + + deploy_to_staging: + runs-on: ubuntu-latest + needs: [publish_on_linux, publish_on_win, publish_on_macos] + steps: + - name: Checkout repository + uses: actions/checkout@v3 - - name: Publish - env: - GH_TOKEN: ${{ secrets.TOKEN }} - run: npm run publish:mac \ No newline at end of file + - name: Deploy to staging environment + run: echo "Deploying to staging environment..." diff --git a/README.md b/README.md index 0c8567d..c2f1791 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ - [📝 تغییرات](#-تغییرات) - [🛡️ حریم خصوصی](#️-حریم-خصوصی) - [🛠 همکاری](#-همکاری) + - [🚀 CI/CD Pipelines](#-cicd-pipelines) ## 📥 دانلود @@ -57,4 +58,14 @@ [CONTRIBUTING.md](./CONTRIBUTING.md) +## 🚀 CI/CD Pipelines + +This project uses GitHub Actions for continuous integration (CI) and continuous deployment (CD). The CI/CD pipelines are configured in the following workflow files: + +- `.github/workflows/build.yml`: This workflow runs on `push` events, excluding changes to `.yml` files and files in the `.github` directory. It includes steps for checking out the repository, setting up Node.js, caching dependencies, installing dependencies, building the project, running tests, linting the code, and generating code coverage reports. + +- `.github/workflows/pull.yml`: This workflow runs on `pull_request` events, excluding changes to `.md` files and files in the `.github` directory. It includes steps for checking out the repository, setting up Node.js, caching dependencies, installing dependencies, building the project, running tests, linting the code, and generating code coverage reports. + +- `.github/workflows/release.yml`: This workflow runs on `push` events to the `main` branch, excluding changes to `README.md`, `README-*.md`, and files in the `.github/ISSUE_TEMPLATE` directory. It includes steps for checking out the repository, setting up Node.js, caching dependencies, installing dependencies, building the project, running tests, linting the code, generating code coverage reports, and deploying the project to a staging environment. Additionally, it includes steps for publishing the built project to GitHub for Linux, Windows, and macOS. + درحال تکمیل فایل توضیحات....