Skip to content

Commit

Permalink
ci: ensure that all packages have manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Jun 25, 2024
1 parent c4bd4fc commit 0ef4ae9
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/ensureManifests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { findWorkspaces } from 'find-workspaces'
import { existsSync } from 'node:fs'

let result = 0

for (const workspace of findWorkspaces()) {
if(workspace.package.private) {
continue
}

if (!(existsSync(workspace.location + '/manifest.ttl'))) {
console.log(`⚠️ ${workspace.package.name} - no manifest.ttl`)
continue
}

if(!workspace.package.files) {
console.log(`✅ ${workspace.package.name} - all files included in package`)
continue
}

if(workspace.package.files.includes('manifest.ttl')) {
console.log(`✅ ${workspace.package.name} - manifest.ttl file listed`)
continue
}

console.error(`❌ ${workspace.package.name} - manifest.ttl file not listed`)
result += 1
}

process.exit(result)
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ jobs:
- run: npm ci
- run: npm run lint

ensure-manifests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: node .github/ensure-manifests.js

smoke-test-cli:
strategy:
fail-fast: false
Expand Down
66 changes: 62 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"c8": "^7.6.0",
"chai": "^4.3.10",
"eslint-import-resolver-typescript": "^3.6.1",
"find-workspaces": "^0.3.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"mocha": "^10.2.0",
Expand Down

0 comments on commit 0ef4ae9

Please sign in to comment.