From fe47f54c38b433e802abbb20b86232fdbdd855f9 Mon Sep 17 00:00:00 2001 From: John Mumm Date: Thu, 7 Aug 2025 10:25:42 +0100 Subject: [PATCH] Consolidate CI keyring tests --- .github/workflows/ci.yml | 138 ++++----------------------------------- 1 file changed, 14 insertions(+), 124 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a556c3ff0..a20da768b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,6 +217,17 @@ jobs: - name: "Install required Python versions" run: uv python install + - name: "Install secret service" + run: | + sudo apt update -y + sudo apt install -y gnome-keyring + + - name: "Start gnome-keyring" + # run gnome-keyring with 'foobar' as password for the login keyring + # this will create a new login keyring and unlock it + # the login password doesn't matter, but the keyring must be unlocked for the tests to work + run: gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' + - name: "Install cargo nextest" uses: taiki-e/install-action@a416ddeedbd372e614cc1386e8b642692f66865e # v2.57.1 with: @@ -228,7 +239,7 @@ jobs: UV_HTTP_RETRIES: 5 run: | cargo nextest run \ - --features python-patch \ + --features python-patch,keyring-tests,secret-service \ --workspace \ --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow @@ -265,7 +276,7 @@ jobs: run: | cargo nextest run \ --no-default-features \ - --features python,python-managed,pypi,git,performance,crates-io \ + --features python,python-managed,pypi,git,performance,crates-io,keyring-tests,apple-native \ --workspace \ --status-level skip --failure-output immediate-final --no-fail-fast -j 12 --final-status-level slow @@ -315,131 +326,10 @@ jobs: run: | cargo nextest run \ --no-default-features \ - --features python,pypi,python-managed \ + --features python,pypi,python-managed,keyring-tests,windows-native \ --workspace \ --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow - keyring-tests-linux: - timeout-minutes: 10 - needs: determine_changes - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} - runs-on: depot-ubuntu-22.04-16 - name: "cargo test | uv-keyring ubuntu" - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - uses: rui314/setup-mold@v1 - - - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 - - - name: "Install secret service" - run: | - sudo apt update -y - sudo apt install -y gnome-keyring - - - name: "Install Rust toolchain" - run: rustup show - - - name: "Install cargo nextest" - uses: taiki-e/install-action@7b20dfd705618832f20d29066e34aa2f2f6194c2 # v2.52.8 - with: - tool: cargo-nextest - - - name: "Start gnome-keyring" - # run gnome-keyring with 'foobar' as password for the login keyring - # this will create a new login keyring and unlock it - # the login password doesn't matter, but the keyring must be unlocked for the tests to work - run: gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' - - - name: "Cargo test" - env: - # Retry more than default to reduce flakes in CI - UV_HTTP_RETRIES: 5 - # run tests single-threaded to avoid dbus race conditions - run: | - cargo nextest run \ - --features keyring-tests \ - --package uv-keyring \ - --test-threads=1 \ - --status-level skip --failure-output immediate-final --no-fail-fast --final-status-level slow - - keyring-tests-windows: - timeout-minutes: 15 - needs: determine_changes - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} - runs-on: depot-windows-2022-16 - name: "cargo test | uv-keyring windows" - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup Dev Drive - run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1 - - # actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone... - - name: Copy Git Repo to Dev Drive - run: | - Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.UV_WORKSPACE }}" -Recurse - - - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 - with: - workspaces: ${{ env.UV_WORKSPACE }} - - - name: "Install Rust toolchain" - working-directory: ${{ env.UV_WORKSPACE }} - run: rustup show - - - name: "Install cargo nextest" - uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19 - with: - tool: cargo-nextest - - - name: "Cargo test" - working-directory: ${{ env.UV_WORKSPACE }} - env: - # Retry more than default to reduce flakes in CI - UV_HTTP_RETRIES: 5 - # Avoid permission errors during concurrent tests - # See https://github.com/astral-sh/uv/issues/6940 - UV_LINK_MODE: copy - shell: bash - run: | - cargo nextest run \ - --features keyring-tests \ - --package uv-keyring \ - --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow - - keyring-test-macos: - timeout-minutes: 15 - needs: determine_changes - # Only run macOS tests on main without opt-in - if: ${{ contains(github.event.pull_request.labels.*.name, 'test:macos') || github.ref == 'refs/heads/main' }} - runs-on: macos-latest-xlarge # github-macos-14-aarch64-6 - name: "cargo test | uv-keyring macos" - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - uses: rui314/setup-mold@v1 - - - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 - - - name: "Install Rust toolchain" - run: rustup show - - - name: "Install cargo nextest" - uses: taiki-e/install-action@c99cc51b309eee71a866715cfa08c922f11cf898 # v2.56.19 - with: - tool: cargo-nextest - - - name: "Cargo test" - env: - # Retry more than default to reduce flakes in CI - UV_HTTP_RETRIES: 5 - run: | - cargo nextest run \ - --features keyring-tests \ - --package uv-keyring \ - --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow - # Separate jobs for the nightly crate windows-trampoline-check: timeout-minutes: 15