Testing Makefile for ademariag on branch 1333/merge #1
Workflow file for this run
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
| --- | |
| name: Makefile Test | |
| run-name: Testing Makefile for ${{ github.actor }} on branch ${{ github.ref_name }} | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - 'Makefile' | |
| - '.github/workflows/makefile-test.yml' | |
| - 'pyproject.toml' | |
| - 'poetry.lock' | |
| - 'ruff.toml' | |
| - '.pre-commit-config.yaml' | |
| pull_request: | |
| paths: | |
| - 'Makefile' | |
| - '.github/workflows/makefile-test.yml' | |
| - 'pyproject.toml' | |
| - 'poetry.lock' | |
| - 'ruff.toml' | |
| - '.pre-commit-config.yaml' | |
| jobs: | |
| test-setup-commands: | |
| name: Test Setup Commands | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Test make install_poetry | |
| run: | | |
| make install_poetry | |
| poetry --version | |
| - name: Test make install | |
| run: | | |
| make install | |
| poetry run python -c "import kapitan; print('Kapitan imported successfully')" | |
| - name: Test make install_external_tools | |
| run: | | |
| make install_external_tools | |
| helm version --short | |
| kustomize version | |
| cue version | |
| - name: Test make install_pre_commit | |
| run: | | |
| make install_pre_commit | |
| test -f .git/hooks/pre-commit || (echo "Pre-commit hook not installed" && exit 1) | |
| - name: Test make setup (full setup) | |
| run: | | |
| # Remove .git/hooks to test fresh setup | |
| rm -f .git/hooks/pre-commit | |
| make setup | |
| poetry --version | |
| kustomize version | |
| cue version | |
| test -f .git/hooks/pre-commit || (echo "Pre-commit hook not installed" && exit 1) | |
| test-lint-commands: | |
| name: Test Linting Commands | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Install dependencies | |
| run: poetry install --with dev --with test --extras "gojsonnet reclass-rs omegaconf" | |
| - name: Test make lint | |
| run: | | |
| make lint | |
| echo "Source code linting passed" | |
| - name: Test make lint-tests | |
| run: | | |
| make lint-tests || true # Allow failures in test linting | |
| echo "Test linting completed" | |
| - name: Test make lint-all | |
| run: | | |
| make lint-all || true # Allow failures | |
| echo "Full linting completed" | |
| - name: Test make check_format | |
| run: | | |
| make check_format | |
| echo "Format check passed" | |
| - name: Test make fix (dry run) | |
| run: | | |
| # Just verify the command runs without error | |
| make fix | |
| echo "Fix command executed successfully" | |
| - name: Test make fix-tests (dry run) | |
| run: | | |
| # Just verify the command runs without error | |
| make fix-tests || true | |
| echo "Fix-tests command executed successfully" | |
| - name: Test make format | |
| run: | | |
| # Run format and check if it modifies any files | |
| make format | |
| git diff --exit-code || echo "Files were formatted" | |
| test-test-commands: | |
| name: Test Testing Commands | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Install dependencies | |
| run: poetry install --with dev --with test --extras "gojsonnet reclass-rs omegaconf" | |
| - name: Install external tools | |
| run: | | |
| make install_external_tools | |
| - name: Test make test_python | |
| run: | | |
| make test_python | |
| echo "Python tests passed" | |
| - name: Test make test_quick | |
| run: | | |
| make test_quick | |
| echo "Quick tests passed" | |
| - name: Test make test_coverage | |
| run: | | |
| make test_coverage | |
| echo "Coverage tests passed" | |
| test-other-commands: | |
| name: Test Other Commands | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Install dependencies | |
| run: poetry install --with dev --with test --with docs --extras "gojsonnet reclass-rs omegaconf" | |
| - name: Test make clean | |
| run: | | |
| # Create some artifacts to clean | |
| mkdir -p dist build kapitan.egg-info __pycache__ .pytest_cache .ruff_cache | |
| make clean | |
| # Verify directories were cleaned | |
| test ! -d dist || (echo "dist not cleaned" && exit 1) | |
| test ! -d build || (echo "build not cleaned" && exit 1) | |
| test ! -d kapitan.egg-info || (echo "egg-info not cleaned" && exit 1) | |
| echo "Clean command worked" | |
| - name: Test make help | |
| run: | | |
| make help | grep -q "Kapitan Development Makefile" || (echo "Help output incorrect" && exit 1) | |
| make help | grep -q "make setup" || (echo "Setup command not in help" && exit 1) | |
| make help | grep -q "make lint" || (echo "Lint command not in help" && exit 1) | |
| make help | grep -q "make test" || (echo "Test command not in help" && exit 1) | |
| echo "Help command works correctly" | |
| - name: Test default make target | |
| run: | | |
| # Running just 'make' should show help | |
| make | grep -q "Kapitan Development Makefile" || (echo "Default target not showing help" && exit 1) | |
| echo "Default make target shows help" | |
| test-docker-commands: | |
| name: Test Docker Commands | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Test make test_docker | |
| run: | | |
| make test_docker | |
| echo "Docker tests passed" |