# This workflow will install Python dependencies, run Pywikibot tests
# with a variety of Python versions. For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Pywikibot CI

on:
  push:
    branches: [ master, stable ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip --version
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
        if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi
        pip install wikitextparser
        python -Werror::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v -debug
    - name: Test with unittest
      run: |
        coverage run -m unittest discover -vv -p \"*_tests.py\"

Add a minimal CI github action worker
[test] Add a minimal CI github action worker

Also add pypy3 to test matrix.

Bug: T101592
Bug: T296371
Change-Id: If379e7bc3a4e22a1615008f6b03517a20e62d006
