[test] fix var names macos #193
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: Tests | |
| on: | |
| push: | |
| branches-ignore: ["main", "master"] | |
| paths: | |
| - 'pytron/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| pull_request: | |
| branches: ["**"] | |
| paths: | |
| - 'pytron/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest, windows-latest] | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🚪 Check for Rust changes | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| rust_native: | |
| - 'pytron/engines/native/**' | |
| - 'pytron/engines/native/Cargo.toml' | |
| rust_loader: | |
| - 'pytron/pack/secure_loader/**' | |
| - 'pytron/pack/secure_loader/Cargo.toml' | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: 'pyproject.toml' | |
| - name: 🦀 Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 🕰️ Setup Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.os }} | |
| workspaces: | | |
| pytron/engines/native | |
| pytron/pack/secure_loader | |
| - name: 🐧 Install Linux System Dependencies | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libcairo2-dev \ | |
| libgirepository1.0-dev \ | |
| libglib2.0-dev \ | |
| pkg-config \ | |
| python3-dev \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| libxdo-dev \ | |
| libssl-dev \ | |
| patchelf | |
| - name: 🍎 Install macOS Dependencies | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| python -m pip install pyobjc-framework-Quartz pyobjc-framework-Cocoa | |
| # On PRs: fast cargo check to catch compile errors without a full build | |
| - name: 🪶 Fast Rust Check (PRs only) | |
| if: github.event_name == 'pull_request' && (steps.filter.outputs.rust_native == 'true' || steps.filter.outputs.rust_loader == 'true') | |
| shell: bash | |
| run: | | |
| if [ "${{ steps.filter.outputs.rust_native }}" == "true" ]; then | |
| cargo check --manifest-path pytron/engines/native/Cargo.toml | |
| fi | |
| if [ "${{ steps.filter.outputs.rust_loader }}" == "true" ]; then | |
| cargo check --manifest-path pytron/pack/secure_loader/Cargo.toml | |
| fi | |
| - name: 🦾 Build Native Engine | |
| if: steps.filter.outputs.rust_native == 'true' || github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| PYO3_PYTHON: python3 | |
| run: python pytron/engines/native/build.py | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| pip install pytest pytest-asyncio | |
| - name: Run Tests | |
| run: pytest |