diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92ebea6..d37016e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,95 +1,31 @@ name: CI on: - pull_request: push: - branches: - - main - workflow_dispatch: + branches: [main] + pull_request: + branches: [main] permissions: contents: read jobs: - repository-hygiene: - name: Repository hygiene + verify: runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v6 - - - name: Validate required project files - run: | - set -euo pipefail - - required_files=( - README.md - LICENSE - ) - - for file in "${required_files[@]}"; do - test -s "$file" - done - - - name: Validate markdown files are not empty - run: | - set -euo pipefail - - markdown_count=0 - - while IFS= read -r -d '' file; do - markdown_count=$((markdown_count + 1)) - test -s "$file" - done < <(find . -type f -name '*.md' -not -path './.git/*' -print0) - - if [ "$markdown_count" -eq 0 ]; then - echo "No markdown files found." - exit 1 - fi - - - name: Run package verification - run: | - set -euo pipefail - - if [ ! -f package.json ]; then - echo "No package.json found; skipping Node checks." - exit 0 - fi - - if [ -f pnpm-lock.yaml ]; then - corepack enable - pnpm install --frozen-lockfile - if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then - pnpm run release:check - else - pnpm run check --if-present - pnpm test --if-present - pnpm run build --if-present - pnpm run smoke --if-present - pnpm run package:smoke --if-present - fi - elif [ -f package-lock.json ]; then - npm ci - if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then - npm run release:check - else - npm run check --if-present - npm test --if-present - npm run build --if-present - npm run smoke --if-present - npm run package:smoke --if-present - fi - else - npm install - if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then - npm run release:check - else - npm run check --if-present - npm test --if-present - npm run build --if-present - npm run smoke --if-present - npm run package:smoke --if-present - fi - fi - + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Install dependencies + run: npm install + - name: npm run check + run: npm run check + - name: npm run build + run: npm run build + - name: npm test + run: npm test + - name: npm run smoke + run: npm run smoke + - name: npm run package:smoke + run: npm run package:smoke diff --git a/package.json b/package.json index 4d7a56b..ad48768 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "LICENSE", "SECURITY.md", "CHANGELOG.md", - "CONTRIBUTING.md" + "CONTRIBUTING.md", + "CODE_OF_CONDUCT.md" ], "scripts": { "check": "node scripts/check.mjs",