Skip to content

Commit

Permalink
Merge branch 'gh_actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kharude, Sachin committed Jan 28, 2021
2 parents 5b97462 + 8e07287 commit 532991a
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 41 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
run:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
activate-environment: test
mamba-version: "*"
channels: conda-forge

- name: Conda install dependencies
shell: bash -l {0}
run: |
conda env update --file ci/env/environment.yml --name test
- name: Install xyzspaces
shell: bash -l {0}
run: pip install .[dev]

- name: Lint check
shell: bash -l {0}
run: |
make clean
make lint
make typing
- name: Test check
shell: bash -l {0}
env:
XYZ_TOKEN: ${{ secrets.XYZ_TOKEN }}
HERE_USER: ${{ secrets.HERE_USER }}
HERE_PASSWORD: ${{ secrets.HERE_PASSWORD }}
run: |
pytest -v --durations=10 --cov-report=xml --cov=xyzspaces tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests

- name: Build Docs and Changelog (Only on Linux for saving time)
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
make draft_changelog
sh scripts/build_docs.sh
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
1 change: 1 addition & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ jobs:
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-close: -1
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions ci/env/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test
channels:
- conda-forge
dependencies:
- backoff>=1.10.0
- geojson
- requests
- geopandas
- turfpy>=0.0.3
- geobuf
- ijson==3.1.1
- pip:
- "-r ../../requirements_dev.txt"
7 changes: 1 addition & 6 deletions tests/space/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,8 @@ def activity_log_space():
sleep(0.5)
yield space

# now teardown (delete temporary space and activity log space)
activity_log_spaceid = space.info["listeners"]["activity-log-writer"][0][
"params"
]["spaceId"]
space2 = Space.from_id(activity_log_spaceid)
# now teardown (delete temporary space)
space.delete()
space2.delete()


@pytest.fixture()
Expand Down
3 changes: 2 additions & 1 deletion tests/space/test_space_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def test_clustering(space_object, empty_space):
empty_space.cluster(clustering="hexbin")


@pytest.mark.flaky(reruns=3, reruns_delay=2)
@pytest.mark.skipif(not XYZ_TOKEN, reason="No token found.")
def test_coordinates_with_altitude(empty_space):
"""Test geojson data having altitude information."""
Expand Down Expand Up @@ -517,6 +518,7 @@ def test_bulk_upload(space_object):
assert ft["properties"]["segment"] == "1158230457T"


@pytest.mark.flaky(reruns=3, reruns_delay=2)
@pytest.mark.skipif(not XYZ_TOKEN, reason="No token found.")
def test_file_bulk_upload(space_object):
geo_file = (
Expand Down Expand Up @@ -588,7 +590,6 @@ def test_schema_validation_new_space(schema_validation_space):
assert resp["type"] == "ErrorResponse"


@pytest.mark.flaky(reruns=3, reruns_delay=2)
@pytest.mark.skipif(not XYZ_TOKEN, reason="No token found.")
def test_activity_log(activity_log_space):
"""Test activity log."""
Expand Down

0 comments on commit 532991a

Please sign in to comment.