diff --git a/.github/workflows/test-requirements.txt b/.github/workflows/test-requirements.txt new file mode 100644 index 00000000..1347173e --- /dev/null +++ b/.github/workflows/test-requirements.txt @@ -0,0 +1,7 @@ +Cython==0.29.10 +aiohttp +tinys3 +twine +psutil +pyOpenSSL==18.0.0 +flake8>=3.7.5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..febdba37 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,48 @@ +name: Tests + +on: + push: + branches: + - master + - ci + pull_request: + branches: + - master + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 4 + matrix: + python-version: [3.6, 3.7] + os: [ubuntu-16.04, macos-10.14] + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 50 + submodules: true + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Install macOS deps + if: matrix.os == 'macos-10.14' + run: | + brew install gnu-sed + brew install --force libtool + brew install --force autoconf + brew install --force automake + + - name: Install Python Deps + run: | + pip install --upgrade setuptools pip wheel + pip install -U -r .github/workflows/test-requirements.txt + + - name: Test + run: | + make distclean && make && make test + make distclean && make debug && make test diff --git a/tests/test_base.py b/tests/test_base.py index 512b0d7a..c063519c 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -159,7 +159,7 @@ def cb(inc=10, stop=False): self.assertEqual(calls, [10, 1]) self.assertFalse(self.loop.is_running()) - self.assertLess(finished - started, 0.1) + self.assertLess(finished - started, 0.2) self.assertGreater(finished - started, 0.04) def test_call_later_2(self): @@ -219,9 +219,10 @@ def cb(): self.assertGreaterEqual(finished - started, 69) def test_call_at(self): - if os.environ.get('TRAVIS_OS_NAME'): + if (os.environ.get('TRAVIS_OS_NAME') + or os.environ.get('GITHUB_WORKFLOW')): # Time seems to be really unpredictable on Travis. - raise unittest.SkipTest('time is not monotonic on Travis') + raise unittest.SkipTest('time is not monotonic on CI') i = 0 diff --git a/tests/test_process.py b/tests/test_process.py index aa7def56..e1eb6cc3 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -840,7 +840,9 @@ def test_process_delayed_stdio__paused__no_stdin(self): }) def test_process_delayed_stdio__not_paused__no_stdin(self): - if os.environ.get('TRAVIS_OS_NAME') and sys.platform == 'darwin': + if ((os.environ.get('TRAVIS_OS_NAME') + or os.environ.get('GITHUB_WORKFLOW')) + and sys.platform == 'darwin'): # Randomly crashes on Travis, can't reproduce locally. raise unittest.SkipTest()