fix: respect a zero mutation probability (#15) #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2026 Santander Group | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # License compliance. genetic-algorithm has no third-party runtime dependencies | |
| # (stdlib-only), so there is no dependency-license allowlist to enforce; this | |
| # workflow verifies that every Python source file declares an | |
| # SPDX-License-Identifier and that no runtime dependency creeps in. | |
| # Replace action references with SHA digests before publishing. | |
| name: License check | |
| on: | |
| push: | |
| branches: [main, development] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| no-runtime-deps: | |
| name: Assert no runtime dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Fail if a dependency manifest is introduced | |
| run: | | |
| set -euo pipefail | |
| if [ -f requirements.txt ] || grep -qE '^\s*dependencies\s*=' pyproject.toml 2>/dev/null; then | |
| echo "FAIL: a runtime dependency manifest was introduced." | |
| echo "genetic-algorithm must remain stdlib-only. If this is intentional," | |
| echo "add a dependency-license allowlist job to this workflow." | |
| exit 1 | |
| fi | |
| echo "OK: no runtime dependency manifest present." | |
| spdx-headers: | |
| name: SPDX headers | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Verify every Python file declares SPDX-License-Identifier | |
| run: | | |
| missing=0 | |
| while IFS= read -r f; do | |
| if ! head -n 5 "$f" | grep -q "SPDX-License-Identifier:"; then | |
| echo "MISSING SPDX header: $f" | |
| missing=$((missing + 1)) | |
| fi | |
| done < <(find genetic_algorithm tests examples -type f -name "*.py") | |
| if [ "$missing" -gt 0 ]; then | |
| echo "Found $missing files without SPDX header." | |
| exit 1 | |
| fi | |
| echo "OK: all Python files have SPDX headers." |