Skip to content

Commit 22db8ee

Browse files
move test to ci job
1 parent 3bbf5d4 commit 22db8ee

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

.github/workflows/build.yaml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,40 @@ jobs:
1313
steps:
1414
- name: Install Docker Buildx
1515
uses: docker/setup-buildx-action@v2
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.11'
20-
16+
- name: Checkout Repo
17+
uses: actions/checkout@v4
2118
- name: Build Docker image
2219
working-directory: ./app
2320
run: |
2421
docker buildx build \
2522
--platform linux/amd64,linux/arm64 \
2623
.
24+
25+
test:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
30+
steps:
31+
- name: Install poetry
32+
run: pipx install poetry
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.11'
37+
38+
- name: Checkout Repo
39+
uses: actions/checkout@v4
40+
41+
- name: Set up cache for Poetry dependencies
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.cache/pypoetry
45+
key: poetry-${{ hashFiles('app/poetry.lock') }}
46+
47+
- name: Install Python dependencies with Poetry
48+
working-directory: ./app
49+
run: poetry install --no-interaction --no-root
50+
51+
- name: Run intercom test
52+
run: python app/test_intercom.py

app/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ COPY . /app
3737
# Expose port 5050 for the Flask application
3838
EXPOSE 5050
3939

40-
# Run test file
41-
RUN python test_intercom.py
42-
4340
# Define environment variable for Flask
4441
ENV FLASK_APP=app.py
4542

0 commit comments

Comments
 (0)