From 9d4f9778bbf6b2c03c81c95e346368cefc7a2963 Mon Sep 17 00:00:00 2001 From: Ilya Siamionau Date: Mon, 14 Aug 2023 19:52:40 +0400 Subject: [PATCH] Run tests on GitHub Actions (#187) --- .github/workflows/build.yml | 2 +- .github/workflows/build_macos_wheels.yml | 2 +- .github/workflows/pytest.yml | 54 ++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df2ea54..bbe3f02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout repository. diff --git a/.github/workflows/build_macos_wheels.yml b/.github/workflows/build_macos_wheels.yml index c76c6d7..6d52e3a 100644 --- a/.github/workflows/build_macos_wheels.yml +++ b/.github/workflows/build_macos_wheels.yml @@ -13,7 +13,7 @@ on: jobs: build_wheels_for_macos: name: Build and publish wheels for macOS - runs-on: macos-latest + runs-on: macos-12 strategy: matrix: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..445a310 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,54 @@ +name: Build and run tests + +on: + push: + branches: + - ci-pytest + pull_request: + branches: + - main + +jobs: + build_and_test: + strategy: + matrix: + os: [ ubuntu-20.04, macos-12, windows-2019 ] + + runs-on: ${{matrix.os}} + continue-on-error: true + + steps: + - name: Checkout repository. + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Move repository to disk C. + if: matrix.os == 'windows-2019' + run: xcopy . C:\src\ /E/H + + - name: Setup Python. + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Build and install package. + if: matrix.os == 'ubuntu-20.04' + run: | + python setup.py install + sudo apt install -y python3.9-dev + + - name: Build and install package. + if: matrix.os == 'macos-12' + run: python setup.py install + + - name: Build and install package. + if: matrix.os == 'windows-2019' + working-directory: "C:/src" + run: python setup.py install + + - name: Install dev dependencies. + run: pip install -r requirements-dev.txt + + - name: Run tests. + run: pytest tests -vv