Support --on/--off on Windows via Named Events #2124
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: smoketests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: # manual execution | |
| jobs: | |
| smoketests: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| python: [ '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Work around arm64 support on MacOS | |
| # https://github.com/actions/virtual-environments/issues/2557 | |
| if: matrix.os == 'macos-latest' | |
| run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| python -m pip install numpy | |
| - name: Build scalene | |
| run: pip -v install -e . | |
| - name: cpu-only smoke test | |
| run: python test/smoketest.py test/testme.py --cpu-only | |
| - name: multiprocessing smoke test | |
| if: matrix.os != 'windows-latest' | |
| run: python test/smoketest.py test/multiprocessing_test.py | |
| # NOTE: This test verifies that spawn-mode Pool.map completes under | |
| # Scalene without hanging (regression test for #998). Uses a wrapper | |
| # script with subprocess timeout because the multiprocessing resource | |
| # tracker can hang during cleanup on some platforms. | |
| - name: multiprocessing spawn pool smoke test | |
| run: python test/smoketest_pool_spawn.py | |
| timeout-minutes: 5 | |
| # Note: test/smoketest.py only handles single JSON, rather than multiple in sequence. | |
| - name: profile-interval smoke test | |
| run: python -m scalene run --profile-interval=2 test/testme.py && python -m scalene view --cli | |
| # NOTE: The decorator smoke test relies on CPU signal sampling which | |
| # doesn't work reliably on Windows CI (similar to the signal smoketest). | |
| - name: decorator smoke test | |
| if: matrix.os != 'windows-latest' | |
| run: python test/smoketest_profile_decorator.py | |
| # NOTE: this is a regression test for signals not being | |
| # restarted properly. It checks whether the program | |
| # halts or runs forever, not for correctness of timing. | |
| - name: signal smoketest | |
| if: matrix.os != 'windows-latest' | |
| run: python test/smoketest.py test/signal_test.py | |
| timeout-minutes: 0.5 | |
| # FIXME: these tests are broken under the current Github runner | |
| # | |
| # - name: line invalidation test | |
| # run: python test/smoketest_line_invalidation.py | |
| # Note: This test doesn't need to read an output, | |
| # it is meant to determine if there is an ImportError | |
| # or anything related if relative imports are used. | |
| - name: -m invocation smoketest | |
| run: | | |
| python -m pip install git+https://github.com/sternj/import_stress_test | |
| python -m scalene run --- -m import_stress_test && python -m scalene view --cli |