From d66b0ceeadc16ec0c92f68d053897e5e054a875a Mon Sep 17 00:00:00 2001 From: PSala Date: Mon, 21 Aug 2023 11:11:20 +0200 Subject: [PATCH] Add ci --- .github/workflows/python-app.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..026e496 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,47 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python Testing + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + run-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ "2.7", "3.11" ] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3 + if: matrix.python-version == '3.11' + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python 2 + if: matrix.python-version == '2.7' + run: | + sudo apt update + sudo apt install python2 python-pip + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 + printf '1\n' | sudo update-alternatives --config python + cd /usr/bin + sudo ln -s /usr/bin/pip2 ./pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + pip install -e . + + - name: Tests + run: | + mamba