diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c6bcada0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,73 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 # focal equivalent + + strategy: + matrix: + include: + - python-version: "2.7" + toxenv: py27-core + - python-version: "3.9" + toxenv: py39-core + - python-version: "3.10" + toxenv: py310-core + - python-version: "3.11" + toxenv: py311-core + - python-version: "3.12" + toxenv: py312-core + - python-version: "3.13" + toxenv: py313-core + - python-version: "2.7" + toxenv: py27-django111 + - python-version: "3.9" + toxenv: py39-django32 + - python-version: "3.10" + toxenv: py310-django42 + - python-version: "3.11" + toxenv: py311-django42 + - python-version: "3.12" + toxenv: py312-django50 + - python-version: "3.13" + toxenv: py313-django51 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + if: matrix.python-version != '2.7' + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python 2.7 and set as default + if: matrix.python-version == '2.7' + run: | + sudo apt-get update + sudo apt-get install -y python2 curl + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py + sudo python get-pip.py + sudo ln -sf /usr/local/bin/pip2 /usr/bin/pip || true + python --version + pip --version + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox pytest + + - name: Set CLOUDINARY_URL + run: | + export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh) + echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)" + echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV + + - name: Run tests + env: + TOXENV: ${{ matrix.toxenv }} + PYTHONPATH: ${{ github.workspace }} + run: tox -e $TOXENV diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6490ba68..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -dist: focal -language: python -matrix: - include: - - python: 2.7 - env: TOXENV=py27-core - - python: 3.9 - env: TOXENV=py39-core - - python: 3.10 - env: TOXENV=py310-core - - python: 3.11 - env: TOXENV=py311-core - - python: 3.12 - env: TOXENV=py312-core - - python: 3.13 - env: TOXENV=py313-core - - python: 2.7 - env: TOXENV=py27-django111 - - python: 3.9 - env: TOXENV=py39-django32 - - python: 3.10 - env: TOXENV=py310-django42 - - python: 3.11 - env: TOXENV=py311-django42 - - python: 3.12 - env: TOXENV=py312-django50 - - python: 3.13 - env: TOXENV=py313-django51 -install: -- pip install tox pytest - -before_script: > - export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh); - echo cloud_name: "$(echo $CLOUDINARY_URL | cut -d'@' -f2)" -script: -- export PYTHONPATH="${PYTHONPATH}:$(pwd)" -- tox -e $TOXENV - -notifications: - email: - recipients: - - sdk_developers@cloudinary.com diff --git a/README.md b/README.md index 93c29daf..63b17053 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://app.travis-ci.com/cloudinary/pycloudinary.svg)](https://app.travis-ci.com/cloudinary/pycloudinary) +[![Tests](https://github.com/cloudinary/pycloudinary/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/cloudinary/pycloudinary/actions/workflows/test.yml) [![PyPI Version](https://img.shields.io/pypi/v/cloudinary.svg)](https://pypi.python.org/pypi/cloudinary/) [![PyPI PyVersions](https://img.shields.io/pypi/pyversions/cloudinary.svg)](https://pypi.python.org/pypi/cloudinary/) [![PyPI DjangoVersions](https://img.shields.io/pypi/djversions/cloudinary.svg)](https://pypi.python.org/pypi/cloudinary/)