Repository navigation
Diagnose instance methods missing a positional receiver #958
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: "CI: Pyrefly" | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '**/*' | |
| - '!.*' | |
| - '.github/workflows/ci_pyrefly.yml' | |
| pull_request: | |
| schedule: | |
| - cron: '0 12 * * 1' # 12pm Monday | |
| workflow_call: | |
| # GitHub sets `head_ref` only for a pull request. A new push to a pull request | |
| # cancels the previous run. All other events use the unique `run_id`. Each of | |
| # these runs gets its own group, and no run cancels a different run. This is | |
| # important for publish_to_pypi.yml and publish_extension.yml, which call this | |
| # workflow to make a release. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macOS-latest] | |
| include: | |
| - os: windows-latest | |
| github_env: $env:GITHUB_ENV | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: tensor-shapes/test-requirements.txt | |
| - name: Check Python formatting (ruff) | |
| run: | | |
| uv tool run --from ruff==0.14.3 ruff format --check --config ruff.toml . | |
| uv tool run --from ruff==0.14.3 ruff check --select I --config ruff.toml . | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| # The VS Code extension's binary finder is a standalone stdlib script, run | |
| # by the user's own interpreter rather than by the extension host, so it is | |
| # tested here instead of in ci_extension_test.yml: this workflow runs on pull | |
| # requests, and its three operating systems are exactly the ones whose | |
| # `sysconfig` install schemes differ. It needs nothing that Cargo builds, so | |
| # it runs before the Rust steps. | |
| - name: Test the Pyrefly binary finder | |
| run: python -m unittest discover -s lsp/resources/test | |
| - name: set windows cargo home | |
| # we need to set CARGO_HOME to a high-up directory on Windows machines, since some dependencies cloned | |
| # by Cargo have long paths and will cause builds/tests to fail | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: echo "CARGO_HOME=C:\\cargo" >> ${{ matrix.github_env }} | |
| - name: set up rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: pyrefly | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| # The cache step runs first, and the Scrut binary goes into the cached | |
| # ~/.cargo/bin. Later runs get Scrut from the cache and do not compile it | |
| # again. | |
| - name: install Scrut | |
| run: cargo install scrut --locked | |
| # Scrut doesn't support Windows yet | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| - run: cargo fmt -- --check | |
| - run: cargo clippy --release | |
| # The release profile's fat LTO and single codegen unit make compiling the | |
| # test binaries very slow, so the tests use the bench profile, which turns | |
| # both off. This also builds the pyrefly binary. | |
| - run: cargo test --profile bench | |
| - name: Check conformance output is up to date | |
| # The generated output is platform-independent, so one OS is enough. It must not | |
| # be Windows: the check keys results by splitting paths on "/". | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: python conformance/conformance_output.py conformance/third_party --mode check --executable target/release/pyrefly | |
| - name: Run Scrut tests | |
| env: | |
| PYREFLY: ${{ github.workspace }}/target/release/pyrefly | |
| TYPESHED_ROOT: ${{ github.workspace }}/crates/pyrefly_bundled/third_party | |
| JQ: jq | |
| TEST_PY: ${{ github.workspace }}/test.py | |
| PYREFLY_PY: ${{ github.workspace }}/pyrefly/python | |
| run: env -u GITHUB_ACTIONS scrut test test | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| # Every library's stub tests run in one step rather than one job per | |
| # library. Type checking runs on the whole matrix because the runners carry | |
| # Windows-specific interpreter and `.exe` path handling that nothing else | |
| # would exercise. Static fallback needs the installed array libraries, so | |
| # the virtualenv is bootstrapped on every platform. Runtime assertions are | |
| # platform-independent and run only on Ubuntu. | |
| - name: Bootstrap tensor-shapes virtualenv | |
| run: python tensor-shapes/bootstrap_venv.py | |
| - name: Run tensor-shape type checks | |
| env: | |
| PYREFLY: ${{ github.workspace }}/target/release/pyrefly | |
| run: python tensor-shapes/run_tests.py --static-only | |
| - name: Run tensor-shape runtime tests | |
| run: python tensor-shapes/run_tests.py --runtime-only | |
| if: ${{ matrix.os == 'ubuntu-latest' }} |