chore: Add macos executor for unit tests
#4038
Workflow file for this run
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 code checks | |
| on: | |
| # Trigger code checks on opening a new pull request. | |
| # Secrets are only made available to the integration tests job, with a manual approval | |
| # step required for PRs from forks. This prevents their potential exposure. | |
| pull_request: | |
| # Pushing to the master branch triggers code checks | |
| push: | |
| branches: | |
| - master | |
| tags-ignore: | |
| - "**" # Ignore all tags to prevent duplicate checks when tags are pushed. | |
| # It should also be possible to trigger checks manually | |
| workflow_dispatch: | |
| jobs: | |
| lint_check: | |
| name: Lint check | |
| uses: apify/workflows/.github/workflows/python_lint_check.yaml@main | |
| with: | |
| python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' | |
| type_check: | |
| name: Type check | |
| uses: apify/workflows/.github/workflows/python_type_check.yaml@main | |
| with: | |
| python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' | |
| unit_tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| HTTPBIN_URL: 'asd' | |
| steps: | |
| - name: macOS cleanup | |
| if: runner.os == 'macOS' | |
| # Disable Spotlight indexing and try to kill all useless processes that could drain CPU during tests | |
| run: | | |
| sudo mdutil -i off / | |
| sudo killall Finder spindump ecosystemanalyticsd SystemUIServer NotificationCenter mds mds_stores mds_worker mdworker mdworker_shared || true | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv package manager | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Python dependencies | |
| run: make install-dev | |
| - name: Run unit tests | |
| run: make unit-tests | |
| docs_check: | |
| name: Docs check | |
| uses: apify/workflows/.github/workflows/python_docs_check.yaml@main | |
| secrets: inherit |