add announcement bars for translations #922
Workflow file for this run
This file contains 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
--- | |
name: Style check | |
env: | |
# Force the stdout and stderr streams to be unbuffered | |
PYTHONUNBUFFERED: 1 | |
on: | |
pull_request: | |
types: | |
- synchronize | |
- reopened | |
- opened | |
jobs: | |
stylecheck: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
check_type: [spellcheck, kbcheck, md-lint] | |
steps: | |
# Add setup steps per check here | |
- uses: actions/checkout@v4 | |
- name: Install Aspell | |
if: matrix.check_type == 'spellcheck' | |
run: sudo apt-get update && sudo apt-get install -y aspell aspell-en | |
- name: Set up Python | |
if: matrix.check_type == 'kbcheck' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
if: matrix.check_type == 'kbcheck' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r 'scripts/knowledgebase-checker/requirements.txt' | |
- name: Setup md-lint environment | |
if: matrix.check_type == 'md-lint' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install markdownlint-cli2 | |
if: matrix.check_type == 'md-lint' | |
run: yarn add -D markdownlint-cli2 | |
# Run the checks here | |
- name: Run checks | |
id: check_step | |
run: | | |
if [[ "${{ matrix.check_type }}" == "spellcheck" ]]; then | |
./scripts/check-doc-aspell | |
exit_code=$? | |
elif [[ "${{ matrix.check_type }}" == "kbcheck" ]]; then | |
./scripts/knowledgebase-checker/knowledgebase_article_checker.py --kb-dir="knowledgebase" | |
exit_code=$? | |
elif [[ "${{ matrix.check_type }}" == "md-lint" ]]; then | |
yarn markdownlint-cli2 --config ./scripts/.markdownlint-cli2.yaml 'docs/**/*.md' | |
exit_code=$? | |
fi | |
if [[ $exit_code -ne 0 ]]; then | |
echo "::error::${{ matrix.check_type }} check failed. See logs for details." | |
exit 1 | |
fi | |
- name: Set check status | |
if: steps.check_step.outcome != 'success' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setFailed('${{ matrix.check_type }} check failed.'); | |
check_overall_status: | |
needs: stylecheck | |
runs-on: ubuntu-latest | |
if: always() # run the job even if stylecheck fails | |
steps: | |
- name: Check overall results | |
if: needs.stylecheck.result != 'success' | |
run: | | |
echo "::error::One or more checks of the style check failed." | |
exit 1 | |