- index.html 파일 생성 및 기본 구조 작성 - 스타일 초기화 및 스와이프 관련 SCSS 파일 추가 - 코드 품질 검사용 GitHub Actions 워크플로우 추가 - 다양한 이미지 파일 추가
71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
name: 코드 품질 검사
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint:
|
|
name: 린트 검사
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 코드 체크아웃
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Node.js 설정
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: 린터 설치
|
|
run: |
|
|
npm install -g htmlhint stylelint stylelint-config-standard stylelint-config-standard-scss
|
|
|
|
- name: HTML 검사
|
|
run: |
|
|
echo "HTML 파일 검사 중..."
|
|
htmlhint "**/*.html" --config <(echo '{
|
|
"tagname-lowercase": true,
|
|
"attr-lowercase": true,
|
|
"attr-value-double-quotes": true,
|
|
"doctype-first": true,
|
|
"tag-pair": true,
|
|
"spec-char-escape": true,
|
|
"id-unique": true,
|
|
"src-not-empty": true,
|
|
"attr-no-duplication": true
|
|
}')
|
|
|
|
- name: CSS/SCSS 검사
|
|
run: |
|
|
echo "CSS/SCSS 파일 검사 중..."
|
|
stylelint "**/*.css" "**/*.scss" --config <(echo '{
|
|
"extends": ["stylelint-config-standard", "stylelint-config-standard-scss"],
|
|
"rules": {
|
|
"no-empty-source": null,
|
|
"selector-class-pattern": null,
|
|
"scss/at-import-partial-extension": null
|
|
}
|
|
}') || true
|
|
|
|
- name: 파일 인코딩 검사
|
|
run: |
|
|
echo "파일 인코딩 검사 중 (UTF-8)..."
|
|
find . -name "*.html" -o -name "*.css" -o -name "*.scss" -o -name "*.js" | head -20 | while read file; do
|
|
if file "$file" | grep -q "UTF-8\|ASCII"; then
|
|
echo "정상: $file"
|
|
else
|
|
echo "경고: $file - UTF-8이 아닐 수 있음"
|
|
fi
|
|
done
|
|
|
|
- name: 검사 결과 요약
|
|
run: |
|
|
echo "===== 코드 품질 검사 완료 ====="
|
|
echo "HTML 파일: $(find . -name '*.html' | wc -l)개"
|
|
echo "CSS 파일: $(find . -name '*.css' | wc -l)개"
|
|
echo "SCSS 파일: $(find . -name '*.scss' | wc -l)개"
|
|
echo "JS 파일: $(find . -name '*.js' | wc -l)개"
|