Skip to content

Commit 3182089

Browse files
committed
Refactor publish-image workflow: change trigger to push events and restructure test job for improved clarity and functionality
1 parent a5df87b commit 3182089

1 file changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/publish-image.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
11
name: Publish Image
22

33
on:
4-
workflow_run:
5-
workflows: ["Test"]
6-
types:
7-
- completed
8-
workflow_dispatch:
4+
push:
5+
branches: ["main"]
6+
tags: ["*"]
97

108
permissions:
119
contents: read
1210
packages: write
1311

1412
jobs:
13+
test:
14+
name: Run tests before publish
15+
runs-on: ubuntu-latest
16+
17+
services:
18+
redis:
19+
image: redis:7-alpine
20+
ports:
21+
- 6379:6379
22+
options: >-
23+
--health-cmd "redis-cli ping"
24+
--health-interval 5s
25+
--health-timeout 5s
26+
--health-retries 5
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install uv (with Python 3.12)
33+
uses: astral-sh/setup-uv@v4
34+
with:
35+
python-version: "3.12"
36+
37+
- name: Install dependencies via uv
38+
run: uv sync --group dev
39+
40+
- name: Run tests
41+
run: uv run pytest --cov=fq_server --cov-branch --cov-report=xml
42+
1543
BuildAndPushImage:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
44+
name: Build and push image
45+
needs: test
1746
runs-on: ubuntu-latest
1847

1948
steps:

0 commit comments

Comments
 (0)