File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -178,8 +178,22 @@ jobs:
178178 name : Docker Image for gwa-compatibility-api
179179 runs-on : ubuntu-latest
180180 steps :
181- - uses : actions/checkout@v2
181+ - uses : actions/checkout@v4
182+ with :
183+ fetch-depth : 2
184+ - name : Check if build needed
185+ id : check
186+ run : |
187+ if git diff --name-only HEAD^ HEAD | grep -q "^microservices/compatibilityApi/\|^.github/workflows/dev.yml"; then
188+ echo "build_needed=true" >> $GITHUB_OUTPUT
189+ else
190+ echo "build_needed=false" >> $GITHUB_OUTPUT
191+ fi
192+ - name : Skip message
193+ if : steps.check.outputs.build_needed == 'false'
194+ run : echo "No changes in compatibilityApi, skipping build"
182195 - uses : docker/build-push-action@v1
196+ if : steps.check.outputs.build_needed == 'true'
183197 with :
184198 registry : docker.pkg.github.com
185199 username : $GITHUB_ACTOR
Original file line number Diff line number Diff line change 5757 poetry run coverage run --branch -m pytest -s -v
5858 poetry run coverage xml
5959
60+ - name : Test coverage for Compatibility API
61+ run : |
62+ export PATH=/root/.local/bin:$PATH
63+ cd microservices/compatibilityApi
64+ poetry install --no-root
65+ poetry run coverage run --branch -m pytest -s -v
66+ poetry run coverage xml
67+
6068 - name : SonarCloud Scan
6169 uses : sonarsource/sonarcloud-github-action@master
6270 env :
@@ -111,3 +119,16 @@ jobs:
111119 push : true
112120 tags : ${{ steps.release.outputs.tag_name }}
113121 tag_with_sha : false
122+
123+ - name : Create gwa-compatibility-api docker image related to the release
124+ uses : docker/build-push-action@v1
125+ with :
126+ registry : docker.pkg.github.com
127+ username : $GITHUB_ACTOR
128+ password : ${{ secrets.GITHUB_TOKEN }}
129+ repository : bcgov/gwa-api/gwa-compatibility-api
130+ path : microservices/compatibilityApi
131+ dockerfile : microservices/compatibilityApi/Dockerfile
132+ push : true
133+ tags : ${{ steps.release.outputs.tag_name }}
134+ tag_with_sha : false
You can’t perform that action at this time.
0 commit comments