diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e3fe02c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: ci +on: + push: + pull_request: + workflow_dispatch: +jobs: + pytest: + strategy: + fail-fast: false # https://github.com/actions/runner-images#available-images + matrix: # https://github.com/actions/python-versions/releases + os: [ubuntu-26.04] # , ubuntu-26.04-arm, macos-latest, macos-26-intel, windows-latest, windows-11-arm] + # python-version: ["3.10", "3.12", "3.14", "3.14t", "3.15", "pypy-3.11"] + python-version: [3.x] + runs-on: ${{ matrix.os }} + steps: + #- uses: leafo/gh-actions-lua@v13 + # with: + # luaVersion: 5.1.5 # https://www.lua.org/versions.html + #- uses: leafo/gh-actions-luarocks@v6 + - if: runner.os == 'macOS' + run: | + brew install pkg-config luarocks + echo "PKG_CONFIG_PATH=$(brew --prefix lua)/lib/pkgconfig" >> "$GITHUB_ENV" + echo "LUA_DIR=$(brew --prefix lua)" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y lua5.1 liblua5.1-0-dev luarocks + - run: lua -h || lua -v + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + - run: pip install --upgrade pip + - env: + PYTHON_LIBRT: "amd64" # "x64" + run: pip install --editable . || true # TODO: Always fails even if $PYTHON_LIBRT is defined + - run: luarocks install lunatic-python || true # TODO: Always fails! luarocks: command not found + # - run: pip install lunatic-python || true # Install from PyPI -- Always fails! + - run: pip install lunatic-python-universal # Install from PyPI + - shell: python # Sanity check + run: | + import lua + lg = lua.globals() + print(f"{type(lg) = }") + print(f"{type(lg.string) = }") + print(f"{type(lg.string.lower) = }") + print(f"{lg.string.lower('Hello world!') = }") + - run: python tests/test_lua.py || true # Segmentation fault (core dumped) + - run: pip install pytest + - run: pytest || true # TODO: Write some pytests + - run: pytest --doctest-modules || true # TODO: Write some pytests