Repository navigation
chore: Remove unused dependencies #176
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 CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" # Do not need to run CI for markdown changes. | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: ./.github/actions/build | |
| - uses: ./.github/actions/build-docs | |
| - name: Run tests | |
| run: make test | |
| - name: Verify typehints | |
| run: make lint | |
| - name: install contract test dependencies | |
| run: make install-contract-tests-deps | |
| - name: start SSE contract test service | |
| run: make start-contract-test-service-bg | |
| - name: run SSE contract tests | |
| uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 | |
| with: | |
| repo: sse-contract-tests | |
| branch: main | |
| version: v2 | |
| test_service_port: 8000 | |
| enable_persistence_tests: "false" | |
| debug_logging: "true" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: start async SSE contract test service | |
| run: make start-async-contract-test-service-bg | |
| - name: run async SSE contract tests | |
| uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 | |
| with: | |
| repo: sse-contract-tests | |
| branch: main | |
| version: v2 | |
| test_service_port: 8001 | |
| enable_persistence_tests: "false" | |
| debug_logging: "true" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # Proves the sdist is complete and functional, since the sdist file list is an | |
| # allowlist and an omission there is otherwise invisible. The test-count check | |
| # is what makes this meaningful: without it, an sdist missing half its tests | |
| # would still pass the tests it did ship. | |
| sdist: | |
| name: sdist (functional) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Count the tests in the checkout | |
| run: | | |
| uv sync --all-extras | |
| count=$(uv run pytest --collect-only -q | grep -oE '[0-9]+ tests? collected' | grep -oE '^[0-9]+') | |
| echo "The checkout collects $count tests." | |
| echo "checkout_tests=$count" >> "$GITHUB_ENV" | |
| - name: Build and unpack the sdist | |
| run: | | |
| uv build --sdist --out-dir dist | |
| mkdir -p "$RUNNER_TEMP/sdist" | |
| tar -xzf dist/*.tar.gz -C "$RUNNER_TEMP/sdist" --strip-components=1 | |
| - name: Check that the sdist ships every test | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: | | |
| uv sync --all-extras | |
| count=$(uv run pytest --collect-only -q | grep -oE '[0-9]+ tests? collected' | grep -oE '^[0-9]+') | |
| echo "The sdist collects $count tests; the checkout collected $checkout_tests." | |
| if [ "$count" -lt "$checkout_tests" ]; then | |
| echo "::error::The sdist is missing tests. Add the missing paths to the include list in [tool.hatch.build.targets.sdist]." | |
| exit 1 | |
| fi | |
| - name: Run the tests from the sdist | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: make test | |
| - name: Verify typehints from the sdist | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: make lint | |
| # start-contract-test-service depends on install-contract-tests-deps, and | |
| # the -bg target backgrounds the whole chain. Without a blocking install | |
| # first, the dependency sync races the harness connecting to the service. | |
| - name: Install the contract test dependencies from the sdist | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: make install-contract-tests-deps | |
| - name: Start the SSE contract test service from the sdist | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: make start-contract-test-service-bg | |
| - name: Run SSE contract tests against the sdist | |
| uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 | |
| with: | |
| repo: sse-contract-tests | |
| branch: main | |
| version: v2 | |
| test_service_port: 8000 | |
| enable_persistence_tests: "false" | |
| debug_logging: "true" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Start the async SSE contract test service from the sdist | |
| working-directory: ${{ runner.temp }}/sdist | |
| run: make start-async-contract-test-service-bg | |
| - name: Run async SSE contract tests against the sdist | |
| uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 | |
| with: | |
| repo: sse-contract-tests | |
| branch: main | |
| version: v2 | |
| test_service_port: 8001 | |
| enable_persistence_tests: "false" | |
| debug_logging: "true" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| windows: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: powershell | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install requirements | |
| run: uv sync --all-extras | |
| - uses: ./.github/actions/build | |
| - uses: ./.github/actions/build-docs | |
| - name: Run tests | |
| run: make test | |
| # Guards the minimum declared dependency versions, since the regular jobs | |
| # run against the locked/latest versions. | |
| floor: | |
| name: floor (lowest-direct deps) | |
| env: | |
| UV_RESOLUTION: lowest-direct | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Run tests | |
| run: make test |