include unit test in the workflow

This commit is contained in:
leehk 2025-04-21 10:33:03 +08:00
parent bc71d74aea
commit 565fc013fc
2 changed files with 15 additions and 23 deletions

View File

@ -1,4 +1,4 @@
name: Build + CI
name: Unittest and Build + CI
# Triggers: Equivalent to ADO trigger block
on:
@ -12,9 +12,22 @@ concurrency:
cancel-in-progress: true
jobs:
run_backend_unittests:
name: Run Backend unit tests
permissions:
checks: write
# Call the reusable workflow for unit tests
uses: ./.github/workflows/template_unit_pytest.yml
# Pass parameters as inputs to the reusable workflow
with:
projectName: Backend # Value defined in original variables
workingDir: app/backend
testsFolderName: tests
# secrets: inherit # Inherit secrets from the parent workflow
# This job defines the matrix and calls the reusable workflow for each image build
build:
needs: run_backend_tests
needs: run_backend_unittests
name: Build ${{ matrix.image_config.IMAGE_NAME }}
# Define necessary permissions if needed (e.g., for GitHub Packages)
permissions:

View File

@ -1,21 +0,0 @@
name: Unit Tests - Backend
# Triggers: Equivalent to ADO trigger block
on:
pull_request:
branches:
- develop
jobs:
run_backend_tests:
name: Run Backend unit tests
permissions:
checks: write
uses: ./.github/workflows/template_unit_pytest.yml
# Pass parameters as inputs to the reusable workflow
with:
projectName: Backend # Value defined in original variables
workingDir: app/backend
testsFolderName: tests
# secrets: inherit # Inherit secrets from the parent workflow