From 0950cde0c6aa8312b62de01adc9271a3bb847e96 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Tue, 3 May 2022 10:11:10 -0400 Subject: [PATCH] [ci] Added github actions --- .github/workflows/ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 43 -------------------- requirements-test.txt | 2 +- 3 files changed, 88 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a42eb0f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +--- + +name: Django OWM Legacy CI Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }} + runs-on: ubuntu-latest + + services: + redis: + image: redis + ports: + - 6379:6379 + + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + - 3.9 + django-version: + - django~=3.2.0 + - django~=4.0.0 + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system packages + run: | + sudo apt update + sudo apt-get -qq -y install sqlite3 gdal-bin libproj-dev \ + libgeos-dev libspatialite-dev spatialite-bin \ + libsqlite3-mod-spatialite + + - name: Upgrade python system packages + run: pip install -U pip wheel setuptools + + - name: Installing module + run: | + pip install -U -e . + pip install -U ${{ matrix.django-version }} + + - name: Install python dependencies + run: pip install -U -r requirements-test.txt + + - name: QA checks + run: ./run-qa-checks + + - name: Tests + run: | + coverage run --source=owm_legacy runtests.py + + - name: Upload Coverage + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}-django-${{ matrix.django-version }} + COVERALLS_PARALLEL: true + + coveralls: + name: Finish Coveralls + needs: build + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a12a574..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: python -cache: pip -dist: focal - -python: - - "3.8" - -env: - - DJANGO="django~=3.1" - -addons: - apt: - packages: - - sqlite3 - - fping - - gdal-bin - - libproj-dev - - libgeos-dev - - libspatialite-dev - - spatialite-bin - - libsqlite3-mod-spatialite - -services: - - redis-server - -branches: - only: - - master - -before_install: - - pip install -U "pip==20.2.4" wheel setuptools - - pip install $DJANGO - - pip install -r requirements-test.txt - -install: - - pip install -e . - -script: - - ./run-qa-checks - - coverage run -a --source=owm_legacy runtests.py - -after_success: - coveralls diff --git a/requirements-test.txt b/requirements-test.txt index 05ffd16..5891346 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,3 @@ coveralls -openwisp-utils[qa]~=0.7.0 +openwisp-utils[qa]~=1.0.0 django-redis