Skip to content

Commit

Permalink
ci: run lint, build and test only for relavant commits
Browse files Browse the repository at this point in the history
  • Loading branch information
shhdharmen committed Dec 10, 2024
1 parent d1bfa41 commit ff90849
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,30 @@ jobs:
HUSKY_SKIP_INSTALL: true
run: npm ci

- name: Check Conventional Commits
id: check-commits
run: |
echo "commit_message=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
if [[ ! $commit_message =~ ^(docs|chore|ci)(\(.+\))?:\s.+$ ]]; then
echo "is_conventional=false" >> $GITHUB_ENV
else
echo "is_conventional=true" >> $GITHUB_ENV
fi
- name: Lint
if: env.is_conventional == 'true'
run: npm run lint -- @ngxpert/hot-toast

- name: Build library
if: env.is_conventional == 'true'
run: npm run build:lib

- name: Build
if: env.is_conventional == 'true'
run: npm run build

- name: Test
if: env.is_conventional == 'true'
run: npm run test

- name: Release
Expand Down

0 comments on commit ff90849

Please sign in to comment.