readme #585
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: Python matrix CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Linux packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install zlib1g-dev libzstd-dev llvm-18 llvm-18-dev | |
| if: runner.os == 'Linux' | |
| - name: Packages | |
| run: | | |
| brew install llvm@18 | |
| echo /opt/homebrew/opt/llvm@18/bin >> $GITHUB_PATH | |
| if: runner.os == 'macOS' | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.56.0 | |
| if: runner.os == 'Windows' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24.x' | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install poetry | |
| run: | | |
| python3 -m pip install poetry | |
| - name: Install all | |
| run: | | |
| poetry install --all-groups --all-extras | |
| if: runner.os == 'Linux' | |
| env: | |
| NYXSTONE_LLVM_PREFIX: /usr/lib/llvm-18 | |
| - name: Install all | |
| run: | | |
| poetry install --all-groups --all-extras | |
| if: runner.os == 'macOS' | |
| env: | |
| NYXSTONE_LLVM_PREFIX: /opt/homebrew/opt/llvm@18 | |
| LDFLAGS: "-L/opt/homebrew/lib" | |
| CPPFLAGS: "-I/opt/homebrew/include" | |
| - name: Install all | |
| run: | | |
| poetry install --without=extended | |
| if: runner.os == 'Windows' | |
| env: | |
| RUSTFLAGS: "-A mismatched-lifetime-syntaxes" | |
| - name: Test with pytest | |
| run: | | |
| poetry run pytest --cov=blint tests | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| poetry run flake8 . --count --exit-zero --statistics | |
| - name: Build on linux | |
| run: | | |
| poetry build --no-cache | |
| if: runner.os == 'Linux' | |
| env: | |
| NYXSTONE_LLVM_PREFIX: /usr/lib/llvm-18 |