diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..7f75894f --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,52 @@ +name: test + +on: + push: + paths: + - '.github/workflows/test.yaml' + - 'lightbus/**' + - 'tests/**' + - 'poetry.lock' + - 'pyproject.toml' + - 'pytest.ini' + - 'lightbus_vendored/**' + +jobs: + test: + name: Test + runs-on: ubuntu-22.04 + + strategy: + matrix: + python: + - '3.8' + - '3.9' + - '3.10' + - '3.11' + + services: + redis: + image: redis:5 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout + uses: actions/checkout@master + + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Install & initialise + run: | + poetry config virtualenvs.in-project true + poetry install + mkdir -p .coverage .test-reports + + - name: Test + run: | + poetry run pytest --cov=lightbus --junit-xml=junit.xml -v -m "not benchmark" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6e79d023..00000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -sudo: required - -env: - global: - - REDIS_URL: redis://127.0.0.1:60791 - - REDIS_URL_B: redis://127.0.0.1:60792 - - PG_URL: postgres://postgres@localhost:54320/postgres - -language: python - -matrix: - fast_finish: true - include: - - python: 3.8 - dist: xenial - sudo: true - - - python: 3.9 - dist: xenial - sudo: true - - - python: 3.10 - dist: xenial - sudo: true - - - python: 3.11 - dist: xenial - sudo: true - - - python: 3.8 - dist: trusty - sudo: false - env: TOXENV=docs - before_install: pip install tox - script: tox - after_script: - on: - branch: master - allow_failures: - - python: 3.8-dev - -cache: - directories: - - .tox - -services: - - docker - -before_install: - # Note that the tests need access to the redis-server binary, - # not just network access - - docker-compose -f tests/docker-compose.yaml up -d db redis_a redis_b - - pip install tox tox-travis coverage coveralls - - mkdir -p .coverage - # Let postgres start up - - | - while ! psql --port=54320 --host=localhost --username=postgres -c 'SELECT 1'> /dev/null 2>&1; do - echo 'Waiting for postgres...' - sleep 1; - done; - -script: - - tox -- --cov=lightbus - -after_script: - - coverage combine .coverage/coverage - - coveralls