[ci] add auto pull; add linux and mac test #7
This file contains 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: Paddle ci test Linux | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
Build-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04] | |
python-version-with-wheel: | |
- ["3.8", "3.8.18", "paddlepaddle-0.0.0-cp38-cp38-linux_x86_64.whl"] | |
- ["3.9", "3.9.18", "paddlepaddle-0.0.0-cp39-cp39-linux_x86_64.whl"] | |
- ["3.10", "3.10.12", "paddlepaddle-0.0.0-cp310-cp310-linux_x86_64.whl"] | |
- ["3.11", "3.11.6", "paddlepaddle-0.0.0-cp311-cp311-linux_x86_64.whl"] | |
runs-on: ${{ matrix.os }} | |
name: linux-py${{ matrix.python-version-with-wheel[0] }}-test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: init system | |
run: | | |
sudo apt-get update | |
sudo apt-get install wget curl git make cmake bzip2 neofetch libffi-dev libsqlite3-dev -y | |
- name: Build Python | |
run: | | |
wget --no-verbose https://www.python.org/ftp/python/${{ matrix.python-version-with-wheel[1] }}/Python-${{ matrix.python-version-with-wheel[1] }}.tgz | |
tar -zvxf Python-${{ matrix.python-version-with-wheel[1] }}.tgz | |
cd Python-${{ matrix.python-version-with-wheel[1] }}/ | |
./configure --enable-optimizations --enable-loadable-sqlite-extensions --with-ssl | |
make -j$(nproc) | |
sudo make install | |
- name: install pip packages | |
run: | | |
python${{ matrix.python-version-with-wheel[0] }} -m pip install --upgrade pip | |
python${{ matrix.python-version-with-wheel[0] }} -m pip install wheel pyyaml ninja | |
python${{ matrix.python-version-with-wheel[0] }} -m pip install -r python/requirements.txt | |
- name: get env | |
run: | | |
python${{ matrix.python-version-with-wheel[0] }} -m pip install distro | |
echo "---------------------- tools/summary_env.py ---------------------------" | |
python${{ matrix.python-version-with-wheel[0] }} tools/summary_env.py | |
echo "-------------------------- neofetch ---------------------------" | |
neofetch | |
echo "------------------------ pip list -----------------------------" | |
pip list | |
- name: run cmake | |
run: | | |
mkdir build | |
cd build | |
cmake .. -GNinja -DPY_VERSION=${{ matrix.python-version-with-wheel[0] }} -DWITH_GPU=OFF -DWITH_TESTING=ON | |
- name: paddle build | |
run: | | |
cd build | |
ninja -j$(nproc) | |
- name: paddle install | |
run: | | |
cd build | |
python${{ matrix.python-version-with-wheel[0] }} -m pip install python/dist/${{matrix.python-version-with-wheel[1]}} | |
- name: paddle run check | |
run: | | |
python${{ matrix.python-version-with-wheel[0] }} -c "import paddle; paddle.utils.run_check()" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.python-version-with-wheel[1] }} | |
path: build/python/dist/${{ matrix.python-version-with-wheel[1] }} | |
- name: run test | |
run: | | |
cd build | |
ctest |