This commit is contained in:
leehk 2025-04-16 17:30:03 +08:00
parent 9189738e59
commit d5e284be3e

View File

@ -50,7 +50,7 @@ jobs:
with: with:
# Pass values from the matrix context and global env # Pass values from the matrix context and global env
project_name: aimingmed-ai project_name: aimingmed-ai
image_repo: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]') image_repo: "ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')"
image_name: ${{ matrix.image_config.IMAGE_NAME }} image_name: ${{ matrix.image_config.IMAGE_NAME }}
build_context: ${{ matrix.image_config.BUILD_CONTEXT }} build_context: ${{ matrix.image_config.BUILD_CONTEXT }}
dockerfile: ${{ matrix.image_config.DOCKERFILE }} dockerfile: ${{ matrix.image_config.DOCKERFILE }}
@ -61,21 +61,15 @@ jobs:
test: test:
name: Run Integration Tests name: Run Integration Tests
needs: build # Ensure this job runs after the build job needs: build # Ensure this job runs after the build job
runs-on: ubuntu-latest # Specify the runner
# Define necessary permissions if needed (e.g., for GitHub Packages) # Define necessary permissions if needed (e.g., for GitHub Packages)
permissions: permissions:
contents: read contents: read
packages: write # If pushing to GitHub Packages registry packages: write # If pushing to GitHub Packages registry
steps:
- name: Set Image Repo
id: set_image_repo
run: echo "image_repo=ghcr.io/$(echo "$GITHUB_REPOSITORY" | tr '[A-Z]' '[a-z]')" >> $GITHUB_OUTPUT
shell: bash
# Call the reusable workflow for testing # Call the reusable workflow for testing
- uses: .github/workflows/template_test.yml # Path to the reusable workflow file uses: ./.github/workflows/template_test.yml # Path to the reusable workflow file
with: with:
projectName: aimingmed-ai projectName: aimingmed-ai
image_repo: ${{ steps.set_image_repo.outputs.image_repo }} image_repo: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')
testContainerName: tests-aimingmedai testContainerName: tests-aimingmedai
# Pass test environment variables as JSON string # Pass test environment variables as JSON string
testEnvs: > testEnvs: >
@ -91,6 +85,7 @@ jobs:
"tests/integration/backend", "tests/integration/backend",
] ]
# Pass image definitions for compose setup as JSON string # Pass image definitions for compose setup as JSON string
# Sensitive values should be passed via secrets and referenced within the template
images: > images: >
[ [
{ {
@ -113,3 +108,4 @@ jobs:
} }
} }
] ]