Skip to content

Commit

Permalink
[ci] add auto pull; add linux and mac test
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil committed Oct 7, 2023
1 parent a46df40 commit 656986c
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions .github/workflows/paddle_ci_test_linux.yaml
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions .github/workflows/paddle_ci_test_mac.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 656986c

Please sign in to comment.