initialize #161
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: tests | |
| on: | |
| push: | |
| workflow_dispatch: | |
| env: | |
| POETRY_VERSION: "1.7.0" | |
| jobs: | |
| deploy: | |
| runs-on: ${{ matrix.runner.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: | |
| - os: macos-14 | |
| ocaml: 5.1 | |
| - os: ubuntu-latest | |
| ocaml: 5.1 | |
| - os: windows-latest | |
| ocaml: system-msvc | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| - name: Checkout Python code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install and configure Poetry | |
| uses: snok/[email protected] | |
| with: | |
| version: ${{ env.POETRY_VERSION }} | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Install Ocaml ${{ matrix.runner.ocaml }} | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: ${{ matrix.runner.ocaml }} | |
| dune-cache: true | |
| - name: Compile and install Ocaml facile library | |
| working-directory: ./ocaml/facile | |
| run: | | |
| opam install . --deps-only | |
| opam exec -- dune build | |
| opam exec -- dune install | |
| - name: Compile Ocaml binding for Facile | |
| working-directory: ./python/binding | |
| run: | | |
| opam install dune-configurator | |
| opam exec -- dune build | |
| - name: Add poetry to windows path | |
| if: ${{ startsWith(runner.os, 'windows') }} | |
| run: | | |
| echo "C:\Users\runneradmin\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| echo "LDSHARED=C:\Users\runneradmin\.opam\default\bin\flexlink.exe -chain msvc" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Install Python facile library | |
| working-directory: ./python | |
| if: ${{ !startsWith(runner.os, 'windows') }} | |
| run: | | |
| opam exec -- poetry install | |
| - name: Install Python facile library | |
| working-directory: ./python | |
| if: ${{ startsWith(runner.os, 'windows') }} | |
| run: | | |
| echo "LDSHARED is $env:LDSHARED" | |
| opam exec -- poetry install | |
| - name: Style checking | |
| working-directory: ./python | |
| run: | | |
| poetry run ruff check facile examples tests | |
| poetry run ruff format --check facile examples tests | |
| # - name: Type checking | |
| # working-directory: ./python | |
| # run: | | |
| # poetry run mypy facile examples tests | |
| - name: Run Pytest and examples | |
| working-directory: ./python | |
| run: | | |
| poetry run pytest | |
| # for file in examples; do poetry run python $file; done | |
| - name: Build wheel | |
| working-directory: ./python | |
| run: | | |
| opam exec -- poetry build | |
| - name: Upload the build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.runner.os }}-${{ matrix.python-version }}-facile-wheel | |
| path: ./python/dist/*.whl |