tests: fix name of GraalPy tests #3629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # Run Pywikibot tests with a variety of Python versions | |
| name: Pywikibot CI | |
| on: | |
| push: | |
| branches: [master, stable] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYWIKIBOT_TEST_RUNNING: 1 | |
| PYWIKIBOT_USERNAME: Pywikibot-test | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
| continue-on-error: ${{ matrix.experimental || false }} | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [pypy3.9, pypy3.10, pypy3.11, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| site: ['wikipedia:en', 'wikisource:zh'] | |
| include: | |
| - python-version: '3.9' | |
| site: wikipedia:test | |
| - python-version: '3.9' | |
| site: false | |
| family: wpbeta | |
| code: en | |
| - python-version: '3.9' | |
| site: false | |
| family: wpbeta | |
| code: zh | |
| - python-version: '3.10' | |
| site: wsbeta:en | |
| - python-version: '3.9' | |
| site: wikidata:test | |
| - python-version: '3.11' | |
| site: wiktionary:ar | |
| test_no_rc: true | |
| - python-version: '3.9' | |
| site: wikidata:wikidata | |
| - python-version: '3.10' | |
| site: wowwiki:uk | |
| - python-version: '3' | |
| site: wikipedia:de | |
| os: macOS-latest | |
| - python-version: 3.13t | |
| site: wikipedia:test | |
| experimental: true | |
| - python-version: 3.14t | |
| site: wikipedia:test | |
| experimental: true | |
| # ubuntu-22.04 required 3.15-dev due to T382214 | |
| - python-version: 3.15-dev | |
| site: wikipedia:en | |
| os: ubuntu-22.04 | |
| - python-version: 3.15-dev | |
| site: wikisource:zh | |
| os: ubuntu-22.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: ${{ endsWith(matrix.python-version, '-dev') }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip --version | |
| if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install wikitextparser | |
| - name: Install setuptools | |
| if: ${{ (matrix.python-version >= '3.12') || (matrix.os == 'macOS-latest') }} | |
| run: pip install setuptools | |
| - name: Generate family files | |
| run: | | |
| if [ ${{matrix.family || 0}} == wpbeta ]; then | |
| python pwb.py generate_family_file http://${{matrix.code}}.wikipedia.beta.wmcloud.org/ wpbeta y | |
| fi | |
| if [ ${{matrix.site || 0}} == 'wsbeta:en' ]; then | |
| python pwb.py generate_family_file http://en.wikisource.beta.wmcloud.org/ wsbeta n | |
| fi | |
| - name: Generate user files | |
| run: | | |
| if [ ${{matrix.site}} != false ]; then | |
| python -Werror::UserWarning -m pwb generate_user_files -site:${{matrix.site}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug; | |
| else | |
| python -Werror::UserWarning -m pwb generate_user_files -family:${{matrix.family}} -lang:${{matrix.code}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug; | |
| fi | |
| echo "usernames['wikipedia']['en'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "usernames['wikisource']['zh'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "usernames['wikipedia']['test'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "usernames['wikidata']['test'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "usernames['meta']['meta'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
| echo "noisysleep = float('inf')" >> user-config.py | |
| echo "maximum_GET_length = 5000" >> user-config.py | |
| echo "console_encoding = 'utf8'" >> user-config.py | |
| echo "import os" >> user-config.py | |
| echo "password_file = os.path.expanduser('passwordfile')" >> user-config.py | |
| echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PYWIKIBOT_USERPWD }}')" > passwordfile | |
| - name: Test with unittest or pytest | |
| id: ci_test | |
| continue-on-error: true | |
| timeout-minutes: 60 | |
| env: | |
| PYWIKIBOT_TEST_NO_RC: ${{ (matrix.site == 'wikisource:zh' || matrix.test_no_rc) && 1 || 0 }} | |
| # Force GIL "off" due to mwparserfromhell issue as suggested by warning in T412624 | |
| PYTHON_GIL: ${{ endsWith(matrix.python-version, 't') && '0' || '1' }} | |
| run: | | |
| python pwb.py version | |
| if [ ${{matrix.site || 0}} != 'wikisource:zh' ]; then | |
| coverage run -m unittest discover -vv -p \"*_tests.py\"; | |
| else | |
| coverage run -m pytest | |
| fi | |
| - name: Show coverage statistics | |
| run: | | |
| coverage combine || true | |
| coverage report | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Check on failure | |
| if: steps.ci_test.outcome == 'failure' | |
| run: | | |
| # Print public IP of runner | |
| curl -s https://api.ipify.org | |
| exit 1 |