Skip to content

Daily random word

Daily random word #198

Workflow file for this run

name: Daily random word
on:
schedule:
# At 06:00 (UTC) every day
- cron: "0 6 * * *"
# Allow to call the workflow manually
workflow_dispatch:
jobs:
# First job just to fill the pip cache
warmup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: python -m pip install -r requirements.txt
daily:
runs-on: ubuntu-latest
needs: [warmup]
strategy:
fail-fast: false
matrix:
locale: # XXX_LOCALES
- "ca"
- "de"
- "el"
- "en"
- "es"
- "fr"
- "it"
- "no"
- "pt"
- "ro"
# - "ru"
- "sv"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Get a random word
id: get-word
run: python -Wd -m wikidict ${{ matrix.locale }} --get-word=''
- name: Check that random word
run: python -Wd -m wikidict ${{ matrix.locale }} --check-word=${{ steps.get-word.outputs.word }}