-
Notifications
You must be signed in to change notification settings - Fork 456
60 lines (50 loc) · 1.67 KB
/
Copy pathquality.yml
File metadata and controls
60 lines (50 loc) · 1.67 KB
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: Repository Quality Checks
on:
pull_request:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
env:
PYTHONUTF8: "1"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Run tests
run: python -m unittest discover -s tests
- name: Compile automation scripts
run: >-
python -m py_compile
tools/build_static_site.py
tools/ingest_resources.py
tools/repository_size_report.py
tests/test_build_static_site.py
tests/test_ingest_resources.py
tests/test_repository_size_report.py
- name: Audit repository consistency
run: python tools/ingest_resources.py audit
- name: Smoke test size report
run: python tools/repository_size_report.py --limit 5 --threshold-mb 50 --json
- name: Smoke test static site index
run: python tools/build_static_site.py --output /tmp/uestc-course-resources.json
- name: Check whitespace in changed files
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git diff --check "origin/${{ github.base_ref }}...HEAD"
elif [[ -n "${{ github.event.before }}" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
git diff --check "${{ github.event.before }}" HEAD
else
git diff --check HEAD~1 HEAD
fi