ci(lint): init (#318)
* ci(lint): init This finishes what #132 started, supersedes #317 (thanks for the stylelint setup!) * ci(lint): add stylelint Co-authored-by: uncenter <[email protected]>
This commit is contained in:
1 parent
6496c51291
commit
ff8da1e094
13 files changed
+1484
-73
No files matched your search
@@ -1,50 +0,0 @@
|
||||
name: File Checker
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
file-checker:
|
||||
name: Required files included
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check files
|
||||
run: |
|
||||
MISSING_FILES=0
|
||||
echo "# Missing Files Found 😢" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
required_files=(
|
||||
"catppuccin.user.css"
|
||||
"assets/mocha.webp"
|
||||
"assets/macchiato.webp"
|
||||
"assets/frappe.webp"
|
||||
"assets/latte.webp"
|
||||
"assets/catwalk.webp"
|
||||
)
|
||||
|
||||
find_files() {
|
||||
local path=$1
|
||||
for file in "${required_files[@]}"; do
|
||||
if [ ! -f "$path/$file" ]; then
|
||||
MISSING_FILES=1
|
||||
echo "- $path/$file" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
for dir in styles/*; do
|
||||
if [ -d "$dir" ]; then
|
||||
find_files "$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $MISSING_FILES -eq 0 ]; then
|
||||
echo "# No Missing Files 🙌" > $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
exit $MISSING_FILES
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
path: ${{ env.DENO_DIR }}
|
||||
|
||||
- name: Generate health files
|
||||
working-directory: src/generate
|
||||
run: ./generate.ts
|
||||
working-directory: ./src
|
||||
run: deno task generate
|
||||
|
||||
- name: Push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
DENO_DIR: deno_cache
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint Userstyles
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.x
|
||||
|
||||
- name: Cache Deno dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ hashFiles('src/deno.lock') }}
|
||||
path: ${{ env.DENO_DIR }}
|
||||
|
||||
- name: Run Lint
|
||||
working-directory: src
|
||||
run: deno task lint
|
||||
@@ -32,8 +32,8 @@ jobs:
|
||||
|
||||
- name: Sync maintainers
|
||||
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
|
||||
working-directory: src/generate
|
||||
run: ./syncMaintainers.ts
|
||||
working-directory: ./src
|
||||
run: deno task sync-maintainers
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user