From b77c608a773d62da3e858e9749e0b114e5e9c7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thau=C3=A3=20Magalh=C3=A3es?= Date: Sat, 6 Apr 2024 07:13:54 -0300 Subject: [PATCH] chore: workflow tests uncommented --- .github/workflows/develop.yml | 6 +- .github/workflows/main.yml | 145 +++++++++++++++++----------------- 2 files changed, 75 insertions(+), 76 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 2e27c95f..0e200349 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -141,16 +141,16 @@ jobs: const versionParts = latestRelease.replace(/^v/, '').split('.'); const newVersion = `${parseInt(versionParts[0])}.${parseInt(versionParts[1])}.${parseInt(versionParts[2]) + 1}`; console.log(`::set-output name=new_version::${newVersion}`); - + - name: Rename file - run: mv .dist/LinguifAI\ Setup\ 0.1.0.exe .dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe + run: mv dist/LinguifAI\ Setup\ 0.1.0.exe dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe - name: Create Release id: create_release uses: softprops/action-gh-release@v1 with: files: | - .dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe + ./dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe tag_name: v${{ steps.get_latest_release.outputs.new_version }} name: Release v${{ steps.get_latest_release.outputs.new_version }} prerelease: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 504e27b1..a36736f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,85 +12,85 @@ concurrency: jobs: # Static tests don't involve any logic or context. # They are just a set of tests that can detect if we are not introducing any faulty code. - # static-test: - # name: 🔬 Static tests - # runs-on: ubuntu-latest - # steps: - # - name: ⬇️ Checkout repo - # uses: actions/checkout@v4 - # with: - # fetch-depth: 2 - - # - name: ⎔ Setup Node - # uses: actions/setup-node@v3 - # with: - # cache: "npm" - - # - name: 🟨 Setup Python - # uses: actions/setup-python@v3 - - # - name: 📦 Install Node dependencies - # run: npm install + static-test: + name: 🔬 Static tests + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: ⎔ Setup Node + uses: actions/setup-node@v3 + with: + cache: "npm" + + - name: 🟨 Setup Python + uses: actions/setup-python@v3 + + - name: 📦 Install Node dependencies + run: npm install # # Unit tests are tests that are not dependent on any external service. # # Usually, they are tests that are testing the logic of a specific function or component. - # unit-test: - # needs: [static-test] - # name: 🚦 Unit tests - # runs-on: ubuntu-latest - # steps: - # - name: ⬇️ Checkout repo - # uses: actions/checkout@v4 - # with: - # fetch-depth: 2 - - # - name: ⎔ Setup Node - # uses: actions/setup-node@v3 - # with: - # cache: "npm" - - # - name: 🟨 Setup Python - # uses: actions/setup-python@v3 - - # - name: 📦 Install dependencies - # run: npm install - - # - name: 🚦 Run unit tests - # run: npm test + unit-test: + needs: [static-test] + name: 🚦 Unit tests + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: ⎔ Setup Node + uses: actions/setup-node@v3 + with: + cache: "npm" + + - name: 🟨 Setup Python + uses: actions/setup-python@v3 + + - name: 📦 Install dependencies + run: npm install + + - name: 🚦 Run unit tests + run: npm test # # Integration tests are tests that are dependent on external services. - # integration-test: - # needs: [static-test] - # name: 🚥 Integration tests - # runs-on: ubuntu-latest - # steps: - # - name: ⬇️ Checkout repo - # uses: actions/checkout@v4 - # with: - # fetch-depth: 2 - - # - name: ⎔ Setup Node - # uses: actions/setup-node@v3 - # with: - # cache: "npm" - - # - name: 🟨 Setup Python - # uses: actions/setup-python@v3 - - # - name: 📦 Install dependencies - # run: npm install - - # # - name: 🐳 Docker compose - # # run: - # # docker-compose up -d && sleep 3 && pnpm prisma migrate reset --force - # # --skip-seed - - # - name: 🚦 Run integration tests - # run: npm test + integration-test: + needs: [static-test] + name: 🚥 Integration tests + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: ⎔ Setup Node + uses: actions/setup-node@v3 + with: + cache: "npm" + + - name: 🟨 Setup Python + uses: actions/setup-python@v3 + + - name: 📦 Install dependencies + run: npm install + + # - name: 🐳 Docker compose + # run: + # docker-compose up -d && sleep 3 && pnpm prisma migrate reset --force + # --skip-seed + + - name: 🚦 Run integration tests + run: npm test # Create Build build: - # needs: [static-test, unit-test, integration-test] + needs: [static-test, unit-test, integration-test] name: 🏗️ Build runs-on: ubuntu-latest steps: @@ -152,14 +152,13 @@ jobs: - name: Rename file run: mv dist/LinguifAI\ Setup\ 0.1.0.exe dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe - - name: Create Release id: create_release uses: softprops/action-gh-release@v1 with: files: | - ./dist/LinguifAI-win32-x64/LinguifAI.exe + ./dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe tag_name: v${{ steps.get_latest_release.outputs.new_version }} release_name: Release v${{ steps.get_latest_release.outputs.new_version }} draft: true