CI: Fix windows targets #213
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: Cargo Build & Test | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: [stable, beta, nightly, anaconda linux, macos, anaconda macos, win64] | |
| include: | |
| - build: stable | |
| os: ubuntu-latest | |
| rust: stable | |
| - build: beta | |
| os: ubuntu-latest | |
| rust: beta | |
| - build: nightly | |
| os: ubuntu-latest | |
| rust: nightly | |
| - build: anaconda linux | |
| os: ubuntu-latest | |
| rust: stable | |
| - build: macos | |
| os: macos-latest | |
| rust: stable | |
| - build: anaconda macos | |
| os: macos-latest | |
| rust: nightly | |
| - build: win64 | |
| os: windows-latest | |
| rust: stable | |
| - build: anaconda win64 | |
| os: windows-latest | |
| rust: stable | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| if: ${{ ! startsWith(matrix.build, 'anaconda') }} | |
| - name: Install Matplotlib (pip) | |
| run: python3 -m pip install -U matplotlib | |
| if: ${{ ! startsWith(matrix.build, 'anaconda') }} | |
| - name: Diagnose Python used (Windows) | |
| if: ${{ matrix.os == 'windows-latest' && ! startsWith(matrix.build, 'anaconda') }} | |
| shell: pwsh | |
| run: | | |
| python -c "import sys, platform; print(sys.executable); print(sys.version); print(platform.platform())" | |
| python -c "import numpy, matplotlib; print('numpy', numpy.__version__); print('matplotlib', matplotlib.__version__)" | |
| - name: Setup Miniconda | |
| if: startsWith(matrix.build, 'anaconda') | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| activate-environment: base | |
| # For Windows + bash: | |
| auto-activate-base: true | |
| - name: Install Matplotlib (Anaconda) | |
| if: startsWith(matrix.build, 'anaconda') | |
| shell: bash | |
| run: conda install -y -c conda-forge matplotlib | |
| - name: Install Rust ${{ matrix.rust }} | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - run: cargo build | |
| if: ${{ ! startsWith(matrix.build, 'anaconda') }} | |
| - run: cargo test | |
| if: ${{ ! startsWith(matrix.build, 'anaconda') }} | |
| - run: cargo run --example a_simple_example | |
| if: ${{ ! startsWith(matrix.build, 'anaconda') }} | |
| - name: Run example with Anaconda | |
| if: startsWith(matrix.build, 'anaconda') | |
| shell: bash | |
| run: | | |
| eval "$($CONDA/bin/conda shell.bash activate)" | |
| mkdir -p target/debug/deps | |
| ln -s $CONDA_PREFIX/lib/libpython* target/debug/deps | |
| cargo run --example a_simple_example |