Skip to content

Commit

Permalink
chore: update gh workflows
Browse files Browse the repository at this point in the history
- use pnpm
- merge doc checks into lint workflow
  • Loading branch information
Yash-Singh1 committed Jan 2, 2024
1 parent 6828add commit 97c634e
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 106 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/ensure-all-rules-everywhere.yml

This file was deleted.

59 changes: 55 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,61 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install npm dependencies
run: npm install
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Install pnpm dependencies
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm run lint

- name: Build code
run: pnpm run build

- name: Run type checks
run: pnpm run type-check

- name: Ensure all rules are in the README
run: pnpm markdownlint README.md docs/README.md --config tests/docs/.markdownlint.json --rules tests/docs/README.js

- name: Ensure all rules are documented
run: |
passes=true
for rule in $(ls lib/rules | sed 's/\.js$//')
do
if [ ! -f "docs/rules/$rule.md" ]
then
passes=false
echo "Expected documentation for $rule to exist"
fi
done
if [ ! "$passes" = true ]
then
exit 1
fi
- name: Ensure all rules are in the documentation sidebar
run: pnpm markdownlint docs/_sidebar.md --config tests/docs/.markdownlint.json --rules tests/docs/_sidebar.js

- name: Copy Documentation README
run: ./.husky/pre-commit

- name: Ensure there is no Git Changes
run: |
if [ -z "$(git status --short)" ]
then
echo "README.md and docs/README.md are in sync"
else
echo "Make sure that the README.md and docs/README.md are in sync"
echo
echo "Difference:"
echo
git diff
exit 1
fi
15 changes: 12 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
registry-url: https://registry.npmjs.org/

- name: Install npm dependencies
run: npm install
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Install pnpm dependencies
run: pnpm install

- name: Build code
run: pnpm run build

- name: Publish Package
run: npm publish --access public
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/readme-in-sync.yml

This file was deleted.

14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 17.x, 18.x, 19.x, 20.x]
node-version: [18.x, 19.x, 20.x, 21.x]

steps:
- name: Clone repository
Expand All @@ -27,11 +27,17 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install npm dependencies
run: npm install
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Install pnpm dependencies
run: pnpm install

- name: Run test against code
run: npm run test
run: pnpm run test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"eslint": ">=8.40.0 <10"
},
"engines": {
"node": ">=16.0.0 <22.0.0"
"node": ">=18.0.0 <22.0.0"
},
"license": "MIT",
"homepage": "https://github.com/Yash-Singh1/eslint-plugin-userscripts#readme",
Expand Down

0 comments on commit 97c634e

Please sign in to comment.