From dc566b9be55dcfbabe61c787b1181b3179010163 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 16 Dec 2023 15:57:44 +0500 Subject: [PATCH] github actions: migrate from travis --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ .travis.yml | 32 ---------------------------- README.md | 2 +- 3 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e0e3e29 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + test: + strategy: + matrix: + python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"] + os: ["ubuntu-22.04"] + include: + - python-version: "3.6" + os: "ubuntu-20.04" + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Include ppa repository + run: sudo add-apt-repository ppa:deadsnakes/ppa + - name: Set up Python ${{ matrix.python-version }} + run: | + sudo apt-get install python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-distutils + sudo update-alternatives --install /usr/bin/python3 python3 `which python${{ matrix.python-version }}` 1 + sudo update-alternatives --install /usr/bin/python3-config python3-config `which python${{ matrix.python-version }}-config` 1 + - name: Upgrade setuptools for Python 3.12 + if: matrix.python-version == '3.12' + run: | + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py + python3 get-pip.py "setuptools > 69.0" + - name: Install requirements + run: python3 -m pip install -r requirements.txt + - name: Install development requirements + run: python3 -m pip install -r requirements_dev.txt + - name: Install postgresql + run: sudo apt-get install postgresql + - name: Test + run: ./scripts/test + - uses: codecov/codecov-action@v1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d0c6ba7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -dist: bionic -language: python - -cache: pip - -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" - -addons: - postgresql: "9.5" - -services: - - postgresql - -before_install: - - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip install -U setuptools~=46.0.0; fi - - if [[ $TRAVIS_PYTHON_VERSION == 3.8 ]]; then pip install -U setuptools~=46.0.0; fi - -install: - - pip install -U -r requirements.txt - - pip install -U -r requirements_dev.txt - -script: - - scripts/test - -after_script: - - pip install codecov - - codecov diff --git a/README.md b/README.md index 6e85bbc..460d963 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://api.travis-ci.com/em92/quakelive-local-ratings.svg?branch=master)](https://travis-ci.com/github/em92/quakelive-local-ratings) +![Build status](https://github.com/em92/quakelive-local-ratings/actions/workflows/build.yml/badge.svg) [![Coverage](https://codecov.io/gh/em92/quakelive-local-ratings/branch/master/graph/badge.svg)](https://codecov.io/gh/em92/quakelive-local-ratings) # quakelive-local-ratings (qllr)