diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..83d6331c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: Run tests +on: [push] +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.7] + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + + steps: + - uses: actions/checkout@develop + - name: Setup Python + uses: actions/setup-python@develop + with: + python-version: 3.7 + - uses: harmon758/postgresql-action@v1 + with: + postgresql version: '11' # See https://hub.docker.com/_/postgres for available versions + - name: Setup geckodriver + - run: | + wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz + tar -xzvf geckodriver-v0.20.1-linux64.tar.gz + sudo mv geckodriver /usr/local/bin + - name: Install dependencies + - run: | + pip install -r requirements/dev.txt + pip install coveralls==0.4.4 + sudo apt-get install python-gdal + - name: Setup after Installation + - run: | + export GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY + export SECRET_KEY=foobarbaz + psql -c "CREATE DATABASE systersdb;" -U postgres + - name: Check flake8 + - run: | + flake8 systers_portal + - name: Run tests + - run: | + coverage run systers_portal/manage.py test --settings=systers_portal.settings.testing + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + name: codecov-umbrella + fail_ci_if_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 003db81c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: true -language: python -dist: bionic -env: - - MOZ_HEADLESS=1 - -addons: - firefox: "55.0" - -services: - - postgresql - -python: - - "3.6" - - "3.7" - -before_install: - - wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz - - tar -xzvf geckodriver-v0.20.1-linux64.tar.gz - - sudo mv geckodriver /usr/local/bin -install: - - "pip install -r requirements/dev.txt" - - pip install coveralls==0.4.4 - - sudo apt-get install python-gdal -before_script: - - export GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY - - export SECRET_KEY=foobarbaz -# - curl -o ipdb.tar.gz https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz -# - tar -xzf ipdb.tar.gz -C systers_portal/ - - psql -c "CREATE DATABASE systersdb;" -U postgres -script: - - coverage run systers_portal/manage.py test --settings=systers_portal.settings.testing - - flake8 systers_portal -notifications: - irc: - channels: "irc.freenode.org#systers-dev" - template: - - "%{repository}@%{branch}: %{message} (%{build_url})" - on_success: change - on_failure: change - use_notice: true - email: false - webhooks: - urls: - - https://webhooks.gitter.im/e/c403378d624b2391961e - on_success: change - on_failure: always - on_start: false -after_success: - coveralls --rcfile=.coveragerc \ No newline at end of file