diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000..22264b1 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,45 @@ +name: Linux arm64 +run-name: Build And Test + +on: [push] + + +env: + XMAKE_ROOT: y + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Prepare XMake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + actions-cache-folder: '.xmake-cache' + actions-cache-key: 'ubuntu' + + - name: Xmake config + run: | + sudo apt update + sudo apt install python3-dev -y + xmake f -p linux -vDy + + - name: Build wheel + run: | + xrepo env python -m venv .venv + source .venv/bin/activate + pip install build + python -m build -w + + - name: Install wheel + run: | + source .venv/bin/activate + pip install dist/* + + - name: Test + run: | + source .venv/bin/activate + python example_add.py \ No newline at end of file diff --git a/example_add.py b/example_add.py new file mode 100644 index 0000000..9738ecb --- /dev/null +++ b/example_add.py @@ -0,0 +1,7 @@ +import example + +print("Checking add ...") + +assert(example.add(42, 69) == 111) + +print("Done !") \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index 3cfe536..8584459 100644 --- a/xmake.lua +++ b/xmake.lua @@ -1,5 +1,5 @@ add_rules("mode.release", "mode.debug") -add_requires("python 3.12.3", "pybind11") +add_requires("pybind11") target("example") set_prefixdir("$(prefixdir)/$(pythondir)", { libdir = "" })