Update workflows for better test coverage and integration (#2344)

* ✨ (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
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-25 10:13:04 -07:00
commit 8ea95420c7
3 changed files with 19 additions and 14 deletions

View file

@ -2,19 +2,20 @@ name: Lint Python
on: on:
pull_request: pull_request:
types: [opened, synchronize, reopened]
paths: paths:
- "poetry.lock" - "poetry.lock"
- "pyproject.toml" - "pyproject.toml"
- "src/backend/**" - "src/backend/**"
- "tests/**" - "tests/**"
merge_group: merge_group:
branches: [dev] types: [checks_requested]
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
jobs: jobs:
lint: lint:
name: Run Mypy
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@ -34,6 +35,8 @@ jobs:
run: | run: |
poetry env use ${{ matrix.python-version }} poetry env use ${{ matrix.python-version }}
poetry install poetry install
- name: Run Mypy
run: |
make lint make lint
env: env:
GITHUB_TOKEN: ${{ secrets.github_token }} GITHUB_TOKEN: ${{ secrets.github_token }}

View file

@ -1,26 +1,21 @@
name: Python tests name: Python tests
on: on:
push:
branches: [main]
paths:
- "poetry.lock"
- "pyproject.toml"
- "src/backend/**"
pull_request: pull_request:
branches: [dev] types: [opened, synchronize, reopened]
branches: [dev, main]
paths: paths:
- "poetry.lock" - "poetry.lock"
- "pyproject.toml" - "pyproject.toml"
- "src/backend/**" - "src/backend/**"
merge_group: merge_group:
branches: [dev] types: [checks_requested]
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
jobs: jobs:
build: build:
name: Run Unit Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:

View file

@ -1,9 +1,13 @@
name: Run Frontend Tests name: Run Frontend Tests
on: on:
pull_request: workflow_dispatch:
paths: inputs:
- "src/frontend/**" branch:
description: "Branch to run tests on"
required: true
type: string
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
@ -15,6 +19,7 @@ env:
jobs: jobs:
setup-and-test: setup-and-test:
name: Run Frontend Tests on branch ${{ inputs.branch }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -24,6 +29,8 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4