From 656986c689bdae6b5d3f27d83cec16784b4a98a7 Mon Sep 17 00:00:00 2001 From: gouzi <530971494@qq.com> Date: Sat, 7 Oct 2023 21:44:50 +0800 Subject: [PATCH] [ci] add auto pull; add linux and mac test --- .github/pull.yml | 8 ++ .github/workflows/paddle_ci_test_linux.yaml | 83 +++++++++++++++++++++ .github/workflows/paddle_ci_test_mac.yaml | 83 +++++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 .github/pull.yml create mode 100644 .github/workflows/paddle_ci_test_linux.yaml create mode 100644 .github/workflows/paddle_ci_test_mac.yaml diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 00000000000000..13597459eb3632 --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,8 @@ +version: "1" +rules: + - base: develop + upstream: PaddlePaddle:develop # change `wei` to the owner of upstream repo + mergeMethod: merge + mergeUnstable: false + conflictReviewers: # Optional, on merge conflict assign a reviewer + - gouzil diff --git a/.github/workflows/paddle_ci_test_linux.yaml b/.github/workflows/paddle_ci_test_linux.yaml new file mode 100644 index 00000000000000..80020747a6a8e6 --- /dev/null +++ b/.github/workflows/paddle_ci_test_linux.yaml @@ -0,0 +1,83 @@ +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 diff --git a/.github/workflows/paddle_ci_test_mac.yaml b/.github/workflows/paddle_ci_test_mac.yaml new file mode 100644 index 00000000000000..80dcad1958c1b9 --- /dev/null +++ b/.github/workflows/paddle_ci_test_mac.yaml @@ -0,0 +1,83 @@ +name: Paddle ci test mac + +on: + pull_request: + workflow_dispatch: + +jobs: + Build-test: + strategy: + fail-fast: false + matrix: + os: [macos-13] + python-version-with-wheel: + - ["3.8", " 3.8.18", "paddlepaddle-0.0.0-cp38-cp38-macosx_13_6_x86_64.whl"] + - ["3.9", " 3.9.18", "paddlepaddle-0.0.0-cp39-cp39-macosx_13_6_x86_64.whl"] + - ["3.10", "3.10.12", "paddlepaddle-0.0.0-cp310-cp310-macosx_13_6_x86_64.whl"] + - ["3.11", "3.11.6", "paddlepaddle-0.0.0-cp311-cp311-macosx_13_6_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: | + brew update + brew install wget curl git make cmake bzip2 neofetch libffi libsqlite3 -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