diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml new file mode 100644 index 00000000000..5dd2ca7c3ad --- /dev/null +++ b/.github/workflows/python_tests.yml @@ -0,0 +1,35 @@ +name: python_tests +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + python_tests: + strategy: + fail-fast: false + matrix: + python-version: [2.7, 3.8] # , 3.9] + runs-on: ubuntu-16.04 # Should match Dockerfile.olbase + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + # https://lxml.de/installation.html#requirements + - run: sudo apt-get install libxml2-dev libxslt-dev + - run: pip install --upgrade pip setuptools wheel + - run: pip install -r requirements_test.txt + - run: pip list --outdated + - if: matrix.python-version == 3.8 + run: make lint-diff + - run: make git + - run: make i18n + # Run legacy Python tests on legacy Infogami + - if: matrix.python-version < 3.0 + run: make test-py && source scripts/run_doctests.sh + # Run both Py2 and Py3 tests on Infogami master + - run: pushd vendor/infogami && git pull origin master && popd + - run: make lint + - run: make test-py + - run: source scripts/run_doctests.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bb06241c6da..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Only run travis when pushing to master branch (and PRs) -branches: - only: - - master - -os: linux -dist: xenial -language: python -jobs: - include: - - name: Python 2.7 - python: "2.7" - - - name: Python 3.8 - python: "3.8" - before_script: - # Do more aggressive linting for newly added code - - make lint-diff - - - name: Node - language: node_js - # Should match what's in our Dockerfile - node_js: "12" - install: npm install - script: - - npm run lint - - make js - - make css - - make components - - npm run test - -install: - - pip install --upgrade pip setuptools wheel - - pip install -r requirements_test.txt - # Need to also test infogami-master - - git clone https://github.com/internetarchive/infogami.git vendor/infogami-master - # Remove symlink in favour of PYTHONPATH - - rm infogami - -script: - - make lint - - make i18n - # Python 2 should also be tested against production infogami - - if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then - PYTHONPATH="$PYTHONPATH:$PWD/vendor/infogami" make test-py; - PYTHONPATH="$PYTHONPATH:$PWD/vendor/infogami" source scripts/run_doctests.sh; - fi - # Both should be tested against infogami-master - - PYTHONPATH="$PYTHONPATH:$PWD/vendor/infogami-master" make test-py - - PYTHONPATH="$PYTHONPATH:$PWD/vendor/infogami-master" source scripts/run_doctests.sh