Skip to content

Commit bc8cdb4

Browse files
feat(ci): build Docker Image on PRs (#382)
* feat(ci): add GitHub Actions workflows for Docker image build and rename PyPI publish * chore: rename cli module to __main__ so it can be executed without having to build * Update .github/workflows/docker_image.yml Co-authored-by: Filip Christiansen <22807962+filipchristiansen@users.noreply.github.com>
1 parent b1eebae commit bc8cdb4

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

.github/workflows/docker_image.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build Docker Image
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Build
19+
uses: docker/build-push-action@v6
20+
with:
21+
push: false
22+
context: .
23+
file: Dockerfile
24+
tags: "${{ github.sha }}"
File renamed without changes.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dev = [
4444
]
4545

4646
[project.scripts]
47-
gitingest = "gitingest.cli:main"
47+
gitingest = "gitingest.__main__:main"
4848

4949
[project.urls]
5050
homepage = "https://gitingest.com"
File renamed without changes.

tests/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99
from click.testing import CliRunner, Result
1010

11-
from gitingest.cli import main
11+
from gitingest.__main__ import main
1212
from gitingest.config import MAX_FILE_SIZE, OUTPUT_FILE_NAME
1313

1414

@@ -72,8 +72,8 @@ def test_cli_with_stdout_output() -> None:
7272
# ─── core expectations (stdout) ────────────────────────────────────-
7373
assert result.exit_code == 0, f"CLI exited with code {result.exit_code}, stderr: {result.stderr}"
7474
assert "---" in result.stdout, "Expected file separator '---' not found in STDOUT"
75-
assert "src/gitingest/cli.py" in result.stdout, (
76-
"Expected content (e.g., src/gitingest/cli.py) not found in STDOUT"
75+
assert "src/gitingest/__main__.py" in result.stdout, (
76+
"Expected content (e.g., src/gitingest/__main__.py) not found in STDOUT"
7777
)
7878
assert not output_file.exists(), f"Output file {output_file} was unexpectedly created."
7979

0 commit comments

Comments
 (0)