Skip to content

Commit 532991a

Browse files
author
Kharude, Sachin
committed
Merge branch 'gh_actions'
2 parents 5b97462 + 8e07287 commit 532991a

File tree

6 files changed

+94
-41
lines changed

6 files changed

+94
-41
lines changed

.github/workflows/main.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
run:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest]
19+
python-version: [3.8]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup conda
25+
uses: conda-incubator/setup-miniconda@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
activate-environment: test
29+
mamba-version: "*"
30+
channels: conda-forge
31+
32+
- name: Conda install dependencies
33+
shell: bash -l {0}
34+
run: |
35+
conda env update --file ci/env/environment.yml --name test
36+
37+
- name: Install xyzspaces
38+
shell: bash -l {0}
39+
run: pip install .[dev]
40+
41+
- name: Lint check
42+
shell: bash -l {0}
43+
run: |
44+
make clean
45+
make lint
46+
make typing
47+
48+
- name: Test check
49+
shell: bash -l {0}
50+
env:
51+
XYZ_TOKEN: ${{ secrets.XYZ_TOKEN }}
52+
HERE_USER: ${{ secrets.HERE_USER }}
53+
HERE_PASSWORD: ${{ secrets.HERE_PASSWORD }}
54+
run: |
55+
pytest -v --durations=10 --cov-report=xml --cov=xyzspaces tests
56+
57+
- name: Upload coverage to Codecov
58+
uses: codecov/codecov-action@v1
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
file: ./coverage.xml
62+
flags: unittests
63+
64+
- name: Build Docs and Changelog (Only on Linux for saving time)
65+
if: matrix.os == 'ubuntu-latest'
66+
shell: bash -l {0}
67+
run: |
68+
make draft_changelog
69+
sh scripts/build_docs.sh
70+
71+
- name: Publish package
72+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
73+
uses: pypa/gh-action-pypi-publish@master
74+
with:
75+
user: __token__
76+
password: ${{ secrets.PYPI_TOKEN }}
77+
verbose: true

.github/workflows/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ jobs:
1717
stale-pr-message: 'Stale pull request message'
1818
stale-issue-label: 'no-issue-activity'
1919
stale-pr-label: 'no-pr-activity'
20+
days-before-close: -1

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

ci/env/environment.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: test
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- backoff>=1.10.0
6+
- geojson
7+
- requests
8+
- geopandas
9+
- turfpy>=0.0.3
10+
- geobuf
11+
- ijson==3.1.1
12+
- pip:
13+
- "-r ../../requirements_dev.txt"

tests/space/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,8 @@ def activity_log_space():
143143
sleep(0.5)
144144
yield space
145145

146-
# now teardown (delete temporary space and activity log space)
147-
activity_log_spaceid = space.info["listeners"]["activity-log-writer"][0][
148-
"params"
149-
]["spaceId"]
150-
space2 = Space.from_id(activity_log_spaceid)
146+
# now teardown (delete temporary space)
151147
space.delete()
152-
space2.delete()
153148

154149

155150
@pytest.fixture()

tests/space/test_space_objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def test_clustering(space_object, empty_space):
425425
empty_space.cluster(clustering="hexbin")
426426

427427

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

519520

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

590592

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

0 commit comments

Comments
 (0)