Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Update Test Coverage

on:
push:
pull_request:

jobs:
python:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
activate-environment: 'true'
enable-cache: true

- name: Install dependencies
run: |
uv sync --all-extras
uv pip install coverage

- name: Run Tests with Coverage
run: coverage run -m pytest

- name: Generate XML Coverage
run: coverage xml

- name: Upload Python coverage artifact
uses: actions/upload-artifact@v7
with:
name: python-coverage
path: coverage.xml

java:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'

- name: Run Java Tests with Coverage
run: mvn test

- name: Upload Java coverage artifact
uses: actions/upload-artifact@v7
with:
name: java-coverage
path: target/site/jacoco/jacoco.xml

upload:
runs-on: ubuntu-latest
needs: [ python, java ]

steps:
- name: Download Python coverage
uses: actions/download-artifact@v7
with:
name: python-coverage

- name: Download Java coverage
uses: actions/download-artifact@v7
with:
name: java-coverage
path: jacoco

- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
files: coverage.xml jacoco/jacoco.xml
format: cobertura

- name: Upload Python report to Codacy
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml

- name: Upload Java report to Codacy
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: jacoco/jacoco.xml
4 changes: 1 addition & 3 deletions .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Upload Python Package

on:
release:
types: [published]
workflow_dispatch:

permissions:
Expand All @@ -15,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@v6

- name: Install uv (faster alternative to pip)
uses: astral-sh/setup-uv@v7
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

Mastermind solver using Java algorithms (performance) + Python UI (terminal).
Goal: Efficiently solve c=9, d=9 cases.
Status: MVP shipped to PyPI. Now improving the Python UI.
Status: Feature complete and shippable. Future edits will likely be small improvements.

### Code Organization

- **Java algorithm**: `./src/main/java/org/mastermind/`
- **Java tests**: `./src/tests/java/org/mastermind/` (JUnit 5)
- **Java tests**: `./src/test/java/org/mastermind/` (JUnit 5)
- **Java benchmarks**: `./src/benchmarks/java/org/mastermind/` (JMH)
- **Python program**: `./src/main/python/mastermind/` (entry point: `main.py`)
- **Python tests**: `./src/tests/python/mastermind/` (pytest)
- **Python tests**: `./src/test/python/mastermind/` (pytest)
- **Build**: `make build-java` → `target/mastermind-solver.jar`

### Algorithm Flow
Expand Down Expand Up @@ -43,7 +43,7 @@ Entry: `main.py` → `java_setup.ensure_ready()` → `welcome.welcome()` (main m

### Current Focus

- Improve Python UI using rich.
- No particular focus.

### Preference

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<!-- @formatter:off -->

<p align="center">
<img src="https://raw.githubusercontent.com/FlysonBot/Mastermind/main/Mastermind%20Logo.svg" width="350" title="Mastermind Logo" alt="Mastermind Logo">
</p>

| **Version:** | [![GitHub tag](https://img.shields.io/github/tag/FlysonBot/Mastermind?include_prereleases=&sort=semver&color=blue)](https://github.com/FlysonBot/Mastermind/tags) [![GitHub Release](https://img.shields.io/github/v/release/FlysonBot/Mastermind?include_prereleases)](https://github.com/FlysonBot/Mastermind/releases) [![Python Version](https://img.shields.io/pypi/pyversions/mastermind-ai)](https://www.python.org/downloads/) [![PyPI - Version](https://img.shields.io/pypi/v/mastermind-ai)](https://pypi.org/project/mastermind-ai/) |

| **Testing:** | [![Testing Status](https://img.shields.io/github/actions/workflow/status/FlysonBot/Mastermind/coverage.yaml?label=test)](https://github.com/FlysonBot/Mastermind/actions/workflows/coverage.yaml) [![Test Coverage](https://coveralls.io/repos/github/FlysonBot/Mastermind/badge.svg?branch=main)](https://coveralls.io/github/FlysonBot/Mastermind?branch=main) [![CodeFactor](https://www.codefactor.io/repository/github/flysonbot/mastermind/badge/main)](https://www.codefactor.io/repository/github/flysonbot/mastermind/overview/main) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/af7ee6c4fbc945f88a41ef8edbea682d)](https://app.codacy.com/gh/FlysonBot/Mastermind/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)|
| --- | :-: |
| **Version:** | [![GitHub tag](https://img.shields.io/github/tag/FlysonBot/Mastermind?include_prereleases=&sort=semver&color=blue)](https://github.com/FlysonBot/Mastermind/tags) [![GitHub Release](https://img.shields.io/github/v/release/FlysonBot/Mastermind?include_prereleases)](https://github.com/FlysonBot/Mastermind/releases) [![Python Version](https://img.shields.io/pypi/pyversions/mastermind-ai)](https://www.python.org/downloads/) [![PyPI - Version](https://img.shields.io/pypi/v/mastermind-ai)](https://pypi.org/project/mastermind-ai/) |
| **Meta:** | [![GitHub License](https://img.shields.io/github/license/FlysonBot/Mastermind)](https://github.com/FlysonBot/Mastermind/blob/main/LICENSE) ![PyPI Status](https://img.shields.io/pypi/status/mastermind-ai) ![Repo Size](https://img.shields.io/github/repo-size/FlysonBot/Mastermind) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/FlysonBot/Mastermind/main.svg)](https://results.pre-commit.ci/latest/github/FlysonBot/Mastermind/main) |

<!-- @formatter:on -->

**Links:**

- [Documentation](https://flysonbot.github.io/Mastermind/)
Expand Down
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@
<finalName>mastermind-solver</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
13 changes: 11 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mastermind-ai"
version = "2.1.0b0"
version = "2.2.0"
requires-python = ">=3.12"
authors = [{ name = "FlysonBot" }]

Expand All @@ -15,7 +15,7 @@ readme = "README.md"
# Tags
keywords = ["mastermind", "game", "puzzle"]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Education",
Expand All @@ -41,6 +41,15 @@ Issues = "https://github.com/FlysonBot/Mastermind/issues"
[tool.setuptools.packages.find]
where = ["src/main/python"]

[tool.pytest.ini_options]
pythonpath = ["src/main/python"]
testpaths = ["src/test/python"]

[dependency-groups]
dev = [
"pytest>=9.0.2",
]

[tool.setuptools]
package-data = { mastermind = ["*.jar", "jre/*.zip"] }

Expand Down
Loading
Loading