Skip to content

Commit

Permalink
Create commons-update.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
athulvis authored Dec 10, 2023
1 parent 42193fe commit 9c7397d
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/commons-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]

schedule:
- cron: '0 23 * * *'

permissions: write-all

env:
PYWIKIBOT_TEST_RUNNING: 1
PYWIKIBOT_USERNAME: Athulvis
PYWIKIBOT_LOGIN_LOGOUT: 1

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1

matrix:
python-version: ["pypy3.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
site: ['commons:commons']
include:
- python-version: 3.10
site: commons:commons


steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate user files
run: |
python -Werror::UserWarning -m pwb generate_user_files -site:${{matrix.site}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py
echo "max_retries = 3" >> 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.PWD }}')" > passwordfile
- name: Test with unittest
timeout-minutes: 10
run: |
python pwb.py wikiupdater

0 comments on commit 9c7397d

Please sign in to comment.