-
Notifications
You must be signed in to change notification settings - Fork 318
60 lines (50 loc) · 1.65 KB
/
check-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
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
steps:
# Step 1: Check out the repository
- name: Check out repository
uses: actions/checkout@v3
# Step 2: Set up environment if required (e.g., installing Aspell)
- name: Install Aspell
run: sudo apt-get update && sudo apt-get install -y aspell aspell-en
# Step 3: Run the spellcheck script
- name: Run spellcheck
run: |
./scripts/check-doc-aspell
continue-on-error: true
id: spellcheck
# Step 4: Setup Python and dependencies for KB checker
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
# Step 5: Install Python dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r 'scripts/knowledgebase-checker/requirements.txt'
# Step 5: Run knowledgebase article checker
- name: Check KB
run: |
./scripts/knowledgebase-checker/knowledgebase_article_checker.py --kb-dir="knowledgebase"
continue-on-error: true
id: kbcheck
# Step 6: Fail the build if any script returns exit code 1
- name: Check exit code
run: |
if [[ "${{ steps.spellcheck.outcome }}" == "failure" ]] || [[ "${{ steps.kbcheck.outcome }}" == "failure" ]]; then
echo "Style check failed. See the logs for details."
exit 1
fi