Skip to content

Commit

Permalink
ci: Run non-database, non-RabbitMQ tests on Windows and macOS (those …
Browse files Browse the repository at this point in the history
…tests require container operations)
  • Loading branch information
jpmckinney committed May 19, 2022
1 parent 22839f7 commit a066785
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/nonlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI (Non-Linux)
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.6
cache: pip
cache-dependency-path: '**/requirements*.txt'
# Don't install editable projects in the current working directory.
# https://pip.pypa.io/en/latest/reference/pip_install/#install-src
- run: pip install --src $GITHUB_WORKSPACE/../src -r requirements_dev.txt
- env:
CI_SKIP: true
run: pytest -W error -rs --cov kingfisher_scrapy
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
2 changes: 1 addition & 1 deletion tests/extensions/test_database_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from tests import spider_with_crawler

database_url = os.getenv('KINGFISHER_COLLECT_DATABASE_URL')
skip_test_if = not database_url and not os.getenv('CI')
skip_test_if = not database_url and (not os.getenv('CI') or os.getenv('CI_SKIP'))


def test_from_crawler_missing_arguments():
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_kingfisher_process_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from tests import ExpectedError, spider_with_crawler, spider_with_files_store

rabbit_url = os.getenv('RABBIT_URL')
skip_test_if = not rabbit_url and not os.getenv('CI')
skip_test_if = not rabbit_url and (not os.getenv('CI') or os.getenv('CI_SKIP'))

items_scraped = [
('build_file', 'file.json', {
Expand Down

0 comments on commit a066785

Please sign in to comment.