@@ -17,11 +17,9 @@ defaults:
1717 run :
1818 working-directory : ./medcat-service
1919jobs :
20- build :
20+ build-test-push :
2121 if : github.event.pull_request.user.login != 'dependabot[bot]' && github.repository == 'CogStack/cogstack-nlp'
2222 runs-on : ubuntu-latest
23- outputs :
24- image_version : ${{ steps.meta.outputs.version }}
2523 steps :
2624 - name : Checkout
2725 uses : actions/checkout@v6
7068 - name : Make medact-v2 available within build
7169 run : cp -r ../medcat-v2 medcat-v2
7270
73- - name : Build and push Docker MedCATservice image
71+ - name : Build Docker MedCATservice image for testing
7472 id : docker_build
73+ uses : docker/build-push-action@v7
74+ with :
75+ context : ./medcat-service/
76+ load : true # https://docs.docker.com/build/ci/github-actions/test-before-push/
77+ allow : network.host
78+ tags : cogstacksystems/medcat-service:test
79+ labels : ${{ steps.meta.outputs.labels }}
80+ cache-from : type=registry,ref=cogstacksystems/medcat-service:buildcache
81+ cache-to : type=registry,ref=cogstacksystems/medcat-service:buildcache,mode=max
82+ build-args : |
83+ REINSTALL_CORE_FROM_LOCAL=true
84+
85+ - name : Run integration tests (matrix variants)
86+ run : |
87+ export IMAGE_TAG=test
88+ for variant in v1 v2 DeID; do
89+ echo "🧪 Running Examples test for variant: ${variant}"
90+ bash scripts/test_examples.sh "${variant}"
91+ done
92+
93+ - name : Push Docker MedCATservice image
7594 uses : docker/build-push-action@v7
7695 with :
7796 context : ./medcat-service/
83102 cache-to : type=registry,ref=cogstacksystems/medcat-service:buildcache,mode=max
84103 build-args : |
85104 REINSTALL_CORE_FROM_LOCAL=true
86-
105+
87106 - name : Extract metadata (tags, labels) for Docker MedCATservice-gpu
88107 id : meta-gpu
89108 uses : docker/metadata-action@v6
@@ -101,8 +120,6 @@ jobs:
101120 # Create version tag based on tag prefix
102121 type=match,pattern=medcat-service/v(\d+\.\d+\.\d+),group=1
103122 flavor : latest=false
104- build-args : |
105- REINSTALL_CORE_FROM_LOCAL=true
106123
107124 - name : Build and push Docker Jupyter singleuser image with GPU support
108125 id : docker_build_gpu
@@ -118,34 +135,7 @@ jobs:
118135 cache-to : type=registry,ref=cogstacksystems/medcat-service-gpu:buildcache,mode=max
119136 build-args : |
120137 REINSTALL_CORE_FROM_LOCAL=true
121-
138+
122139 - name : Image digest
123140 run : echo ${{ steps.docker_build.outputs.digest }}
124141 working-directory : " ./"
125- integration_test :
126- runs-on : ubuntu-latest
127- needs : build
128- strategy :
129- matrix :
130- variant : [v1, v2, DeID]
131- steps :
132-
133- - name : Check out code
134- uses : actions/checkout@v6
135-
136- - name : Run Test with example model pack
137- run : |
138- echo "🧪 Running Examples test..."
139- export IMAGE_TAG=${{ needs.build.outputs.image_version }} # Improve by running exact digest instead
140- echo "Running with image tag ${IMAGE_TAG} and variant ${{ matrix.variant }}"
141- bash scripts/test_examples.sh ${{ matrix.variant }}
142-
143- - name : Report test result
144- if : always()
145- run : |
146- if [ $? -eq 0 ]; then
147- echo "✅ Integration test PASSED"
148- else
149- echo "❌ Integration test FAILED"
150- exit 1
151- fi
0 commit comments