Add lazy provider singletons for convenient provider access #54
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: Run Tests | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| python_version: ['3.11', '3.12', '3.13', '3.14'] | |
| os: [ubuntu-latest, macOS-latest] # TODO: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python_version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install Nix on macOS | |
| if: runner.os == 'macOS' | |
| uses: DeterminateSystems/nix-installer-action@v16 | |
| - name: Setup venv and install pip dependencies | |
| run: | | |
| uv venv --python "${{ matrix.python_version }}" \ | |
| && uv sync --all-extras \ | |
| && uv pip install pip \ | |
| && echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" \ | |
| && if [ -d /nix/var/nix/profiles/default/bin ]; then echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"; fi | |
| - name: Run standard test suite | |
| run: | | |
| source .venv/bin/activate \ | |
| && python tests.py | |
| live-integration: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: [ubuntu-latest, macos-15-intel] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v16 | |
| - name: Setup Docker on macOS | |
| if: runner.os == 'macOS' | |
| uses: docker/setup-docker-action@v4 | |
| env: | |
| LIMA_START_ARGS: --vm-type=vz | |
| with: | |
| daemon-config: | | |
| { | |
| "debug": true | |
| } | |
| - name: Setup venv and install pip dependencies | |
| run: | | |
| uv venv --python "3.12" \ | |
| && uv sync --all-extras \ | |
| && uv pip install pip \ | |
| && echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" \ | |
| && echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" | |
| - name: Inspect Docker on macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| docker version \ | |
| && docker info | |
| - name: Run non-root live package lifecycle tests on macOS | |
| if: runner.os == 'macOS' | |
| env: | |
| ABX_PKG_LIVE_PKG_TESTS: "1" | |
| run: | | |
| source .venv/bin/activate \ | |
| && python -m unittest \ | |
| tests.LiveUpdateAndUninstallTest.test_brew_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_pip_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_npm_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_cargo_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_gem_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_go_get_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_nix_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_docker_provider_live_update_and_uninstall | |
| - name: Run non-root live package lifecycle tests on Linux | |
| if: runner.os == 'Linux' | |
| env: | |
| ABX_PKG_LIVE_PKG_TESTS: "1" | |
| run: | | |
| source .venv/bin/activate \ | |
| && python -m unittest \ | |
| tests.LiveUpdateAndUninstallTest.test_pip_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_npm_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_cargo_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_gem_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_go_get_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_nix_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_docker_provider_live_update_and_uninstall | |
| - name: Run root-required live package lifecycle tests on Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo env "PATH=$PATH:/nix/var/nix/profiles/default/bin" "ABX_PKG_LIVE_PKG_TESTS=1" ./.venv/bin/python -m unittest \ | |
| tests.LiveUpdateAndUninstallTest.test_apt_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_pyinfra_provider_live_update_and_uninstall \ | |
| tests.LiveUpdateAndUninstallTest.test_ansible_provider_live_update_and_uninstall |