Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Run linter
run: npm run lint
run: pnpm run lint

- name: Run tests
run: npm test
run: pnpm test

- name: Build project
run: npm run build
run: pnpm run build

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -46,11 +51,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run security audit
run: npm audit --audit-level moderate
run: pnpm audit --audit-level moderate

- name: Check dependencies
run: npx depcheck --config=.depcheckrc
run: pnpm dlx depcheck --config=.depcheckrc

publish:
needs: [test, security]
Expand All @@ -60,17 +79,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build project
run: npm run build
run: pnpm run build

- name: Validate version
run: |
Expand All @@ -83,6 +108,6 @@ jobs:
echo "Version validated!"

- name: Publish to NPM
run: npm publish
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading