Skip to content

ci: Fail the daily on missing template #12

ci: Fail the daily on missing template

ci: Fail the daily on missing template #12

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@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: actions/cache@v3
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@v4
with:
python-version: "3.x"
- uses: actions/cache@v3
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
id: check-word
run: python -Wd -m wikidict ${{ matrix.locale }} --check-word=${{ steps.get-word.outputs.word }}
- name: Missing template(s)?
if: contains('!! Missing', steps.check-word.outputs.stdout)
run: exit 1