Skip to content

Commit

Permalink
Adds tests for validating github user data as per schema (#460)
Browse files Browse the repository at this point in the history
* add tests for validating github user data schema

* update scraper dry run to validate schema

* update triggers for dry run workflow

* fix data-repo path

* fix data repo path

* fix data repo path

* run `mkdir contributors` before attempting to scan the dir
  • Loading branch information
rithviknishad authored Jun 26, 2024
1 parent 917c659 commit c9fa7bf
Show file tree
Hide file tree
Showing 6 changed files with 3,346 additions and 2,332 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/scraper-dry-run.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Scraper Dry Run
name: Scraper Dry Run & Validate Schema

on:
workflow_dispatch:
Expand All @@ -15,6 +15,8 @@ jobs:
permissions:
issues: read
pull-requests: read
env:
DATA_REPO: ./
steps:
- uses: actions/checkout@v4

Expand All @@ -31,6 +33,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: mkdir contributors

- name: Generate markdown files for new contributors
run: node scripts/generateNewContributors.js
env:
Expand All @@ -43,3 +47,34 @@ jobs:
path: |
data
contributors
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Tests
run: pnpm test
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint-fix": "eslint . --fix",
"format": "prettier --write .",
"load-data": "node ./scripts/loadOrgData.js",
"prepare": "husky install"
"prepare": "husky install",
"test": "mocha tests"
},
"dependencies": {
"@headlessui/react": "^1.7.18",
Expand Down Expand Up @@ -40,18 +41,23 @@
"@types/node": "^20.11.21",
"@types/react": "^18.2.60",
"autoprefixer": "^10.4.17",
"chai": "^5.1.1",
"chai-json-schema": "^1.5.1",
"dotenv": "^16.4.5",
"eslint": "8.16.0",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-tailwindcss": "^3.14.3",
"husky": "^8.0.3",
"mocha": "^10.5.1",
"octokit": "^3.1.2",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"strip-json-comments": "^5.0.1",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"yaml": "^2.4.5"
}
}
}
Loading

0 comments on commit c9fa7bf

Please sign in to comment.