diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml new file mode 100644 index 0000000..1b2d30c --- /dev/null +++ b/.github/workflows/build_and_test.yaml @@ -0,0 +1,78 @@ +name: build and test + +on: + pull_request: + branches: + - develop + paths-ignore: + - ".github/**" + - "docs/**" + - "README.md" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_and_test_cpu: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ["3.7", "3.8"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: python -m pip install pip --upgrade --user + - name: Install PaddlePaddle + run: python -m pip install paddlepaddle==2.3.1 -i https://mirror.baidu.com/pypi/simple + - name: Install PaddleRS + run: | + pip install -r requirements.txt + pip install -e . + - name: Install pre-commit hooks + run: | + pip install pre-commit + pre-commit install + - name: Lint + run: pre-commit run --all-files + - name: Run unittests + run: | + cd tests + bash check_coverage.sh + shell: bash + + build_and_test_cuda102: + runs-on: ubuntu-latest + container: + image: registry.baidubce.com/paddlepaddle/paddle:2.3.1-gpu-cuda10.2-cudnn7 + strategy: + matrix: + python-version: ["3.7", "3.8"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: python -m pip install pip --upgrade --user + - name: Install PaddleRS + run: | + pip install -r requirements.txt + pip install -e . + - name: Install pre-commit hooks + run: | + pip install pre-commit + pre-commit install + - name: Lint + run: pre-commit run --all-files + - name: Run unittests + run: | + cd tests + bash check_coverage.sh + shell: bash \ No newline at end of file