-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 3.42 KB
/
completeness_check.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Validate README and Links
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate README sections
run: |
if ! grep -q "## Overview" README.md || \
! grep -q "## Benchmark" README.md || \
! grep -q "## Specification" README.md || \
! grep -q "## Getting started" README.md; then
echo "README.md is missing one or more required sections." && exit 1;
fi
- name: Check if https://lvgl.io/boards has a link to this repo
run: |
REPO_URL=$(git config --get remote.origin.url | sed 's/\.git$//')
curl -s https://lvgl.io/boards | grep -q "$REPO_URL"
if [ $? -ne 0 ]; then
echo "https://lvgl.io/boards does not have a link to this repository." && exit 1;
fi
- name: Check if https://github.com/lvgl/lvgl_project_creator/blob/master/manifests has a link to this repo
run: |
REPO_URL=$(git config --get remote.origin.url | sed 's/.*\/\/[^\/]*\/\([^\/]*\/[^\/]*\).*/\1/')
curl -s https://raw.githubusercontent.com/lvgl/lvgl_project_creator/master/manifests | grep -q "$REPO_URL"
if [ $? -ne 0 ]; then
echo "Manifest does not contain a link to this repository." && exit 1;
fi
- name: Check for single lv_conf files
run: |
echo "Checking for single lv_conf.h and lv_conf.defaults files..."
# Find files
LV_CONF_H_COUNT=$(find . -type f -name "lv_conf.h" | wc -l)
LV_CONF_DEFAULT_COUNT=$(find . -type f -name "lv_conf.defaults" | wc -l)
echo "Found $LV_CONF_H_COUNT lv_conf.h file(s)."
echo "Found $LV_CONF_DEFAULT_COUNT lv_conf.defaults file(s)."
# Validate counts
if [ "$LV_CONF_H_COUNT" -ne 1 ]; then
echo "❌ There should be exactly one lv_conf.h file, but found $LV_CONF_H_COUNT."
exit 1
fi
if [ "$LV_CONF_DEFAULT_COUNT" -ne 1 ]; then
echo "❌ There should be exactly one lv_conf.defaults file, but found $LV_CONF_DEFAULT_COUNT."
exit 1
fi
echo "✅ File checks passed."
- name: Check for lv_conf.defaults in root
run: |
if [ ! -f lv_conf.defaults ]; then
echo "lv_conf.defaults file is missing in the root directory." && exit 1;
fi
- name: Check if the repo URL is in the branch updater
run: |
FILE_URL="https://raw.githubusercontent.com/lvgl/lvgl/master/scripts/release_branch_updater_port_urls.txt"
REPO_URL_TO_CHECK="https://github.com/${{ github.repository }}"
echo "Checking if $REPO_URL_TO_CHECK exists in $FILE_URL..."
# Download the file and check for the URL
if curl -s $FILE_URL | grep -Fxq "$REPO_URL_TO_CHECK"; then
echo "✅ The repository URL is listed
else
echo "❌ The repository URL is NOT"
exit 1
fi
- name: Check for YouTube link in README
run: |
if ! grep -qE 'https://(www\.)?youtube\.com|youtu\.be' README.md; then
echo "README.md is missing a link to a YouTube video." && exit 1;
fi