From 8ea95420c74fd53eb5e078b785c11ef3df5a03fe Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 25 Jun 2024 10:13:04 -0700 Subject: [PATCH] Update workflows for better test coverage and integration (#2344) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ (typescript_test.yml): add workflow_dispatch event to trigger workflow manually with branch input parameter 🔧 (typescript_test.yml): update workflow to checkout code from the specified branch when triggered manually * 📝 (lint-py.yml): update linting workflow to trigger on specific pull request events and checks requested action 📝 (lint-py.yml): add a specific job to run Mypy for static type checking in the linting workflow * 🔧 (python_test.yml): update pull_request event types and branches to trigger on more actions for better test coverage and integration --- .github/workflows/lint-py.yml | 7 +++++-- .github/workflows/python_test.yml | 13 ++++--------- .github/workflows/typescript_test.yml | 13 ++++++++++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint-py.yml b/.github/workflows/lint-py.yml index 9dab54eb8..8a4abe0f9 100644 --- a/.github/workflows/lint-py.yml +++ b/.github/workflows/lint-py.yml @@ -2,19 +2,20 @@ name: Lint Python on: pull_request: + types: [opened, synchronize, reopened] paths: - "poetry.lock" - "pyproject.toml" - "src/backend/**" - "tests/**" merge_group: - branches: [dev] - + types: [checks_requested] env: POETRY_VERSION: "1.8.2" jobs: lint: + name: Run Mypy runs-on: ubuntu-latest strategy: matrix: @@ -34,6 +35,8 @@ jobs: run: | poetry env use ${{ matrix.python-version }} poetry install + - name: Run Mypy + run: | make lint env: GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index 4846f59fb..9e065c58f 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -1,26 +1,21 @@ name: Python tests on: - push: - branches: [main] - paths: - - "poetry.lock" - - "pyproject.toml" - - "src/backend/**" pull_request: - branches: [dev] + types: [opened, synchronize, reopened] + branches: [dev, main] paths: - "poetry.lock" - "pyproject.toml" - "src/backend/**" merge_group: - branches: [dev] - + types: [checks_requested] env: POETRY_VERSION: "1.8.2" jobs: build: + name: Run Unit Tests runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index 8fd809020..bd06b5dab 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -1,9 +1,13 @@ name: Run Frontend Tests on: - pull_request: - paths: - - "src/frontend/**" + workflow_dispatch: + inputs: + branch: + description: "Branch to run tests on" + required: true + type: string + env: POETRY_VERSION: "1.8.2" @@ -15,6 +19,7 @@ env: jobs: setup-and-test: + name: Run Frontend Tests on branch ${{ inputs.branch }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -24,6 +29,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} - name: Setup Node.js uses: actions/setup-node@v4