mirror of
https://github.com/semgrep/skills.git
synced 2026-09-20 14:21:26 +08:00
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
validate-and-build:
|
|
name: Validate & Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version: '20'
|
|
cache: 'pnpm'
|
|
cache-dependency-path: packages/skill-build/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: make install
|
|
|
|
- name: Validate skills
|
|
run: make validate
|
|
|
|
- name: Build skills
|
|
run: make build
|
|
|
|
- name: Check for uncommitted changes
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo "::error::Generated files are out of sync. Please run 'make' locally and commit the changes."
|
|
echo ""
|
|
echo "Changed files:"
|
|
git status --porcelain
|
|
echo ""
|
|
echo "Diff:"
|
|
git diff
|
|
exit 1
|
|
fi
|
|
echo "All generated files are up to date."
|
|
|
|
- name: Create zip packages
|
|
run: make zip
|
|
|
|
- name: Upload skill packages
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: skill-packages
|
|
path: skills/*.zip
|
|
retention-days: 7
|