Skip to content

Commit f32f4ff

Browse files
authored
Merge pull request #2595 from obiwan04kanobi/feature/issue-2196-ci-docker-build-test
Add Docker build test to CI workflow (#2196)
2 parents 7379ba7 + b99719c commit f32f4ff

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.github/workflows/regression.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '**/*.py'
1212
- '**/*.ini'
1313
- '**/*.toml'
14+
- 'Dockerfile'
1415
push:
1516
branches:
1617
- master
@@ -21,11 +22,13 @@ on:
2122
- '**/*.py'
2223
- '**/*.ini'
2324
- '**/*.toml'
25+
- 'Dockerfile'
2426

2527
jobs:
2628
tox-lint:
27-
# Linting is ran through tox to ensure that the same linter is used by local runners
2829
runs-on: ubuntu-latest
30+
# Linting is ran through tox to ensure that the same linter
31+
# is used by local runners
2932
steps:
3033
- uses: actions/checkout@v4
3134
- name: Set up linting environment
@@ -41,7 +44,8 @@ jobs:
4144
tox-matrix:
4245
runs-on: ${{ matrix.os }}
4346
strategy:
44-
fail-fast: false # We want to know what specicic versions it fails on
47+
# We want to know what specicic versions it fails on
48+
fail-fast: false
4549
matrix:
4650
os: [
4751
ubuntu-latest,
@@ -67,3 +71,22 @@ jobs:
6771
pip install tox-gh-actions
6872
- name: Run tox
6973
run: tox
74+
docker-build-test:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v4
79+
- name: Set up Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
- name: Get version from pyproject.toml
82+
id: get-version
83+
run: |
84+
VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d'"' -f2)
85+
echo "version=$VERSION" >> $GITHUB_OUTPUT
86+
- name: Build Docker image
87+
run: |
88+
docker build \
89+
--build-arg VERSION_TAG=${{ steps.get-version.outputs.version }} \
90+
-t sherlock-test:latest .
91+
- name: Test Docker image runs
92+
run: docker run --rm sherlock-test:latest --version

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# 3. Build image with BOTH latest and version tags
55
# i.e. `docker build -t sherlock/sherlock:0.16.0 -t sherlock/sherlock:latest .`
66

7-
FROM python:3.12-slim-bullseye as build
7+
FROM python:3.12-slim-bullseye AS build
88
WORKDIR /sherlock
99

1010
RUN pip3 install --no-cache-dir --upgrade pip

0 commit comments

Comments
 (0)