chore(deps-dev): bump the npm-development group across 1 directory with 17 updates #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
test-typescript: | |
name: TypeScript Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
id: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
- name: Install Dependencies | |
id: npm-ci | |
run: npm ci | |
- name: Check Format | |
id: npm-format-check | |
run: npm run format:check | |
- name: Lint | |
id: npm-lint | |
run: npm run lint | |
- name: Test | |
id: npm-ci-test | |
run: npm run ci-test | |
positive-tests: | |
name: Positive Action Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Test direct text (not case-sensitive) | |
id: test-direct-text | |
uses: ./ | |
with: | |
text: "Hey @PrOfEssortocat, I'm finished with my task" | |
keyphrase: '@professortocat' | |
- name: Test text file (not case-sensitive) | |
id: test-text-file | |
uses: ./ | |
with: | |
text-file: ./__tests__/test-mixed-case.md | |
keyphrase: 'github' | |
minimum-occurrences: '3' | |
- name: Test maximum-occurrences (positive case) | |
id: test-max-occurrences-positive | |
uses: ./ | |
with: | |
text-file: ./__tests__/test-two-occurrences.md | |
keyphrase: 'github' | |
maximum-occurrences: '3' | |
- name: Test exact occurrences (positive case) | |
id: test-exact-occurrences-positive | |
uses: ./ | |
with: | |
text-file: ./__tests__/test-two-occurrences.md | |
keyphrase: 'github' | |
minimum-occurrences: '2' | |
maximum-occurrences: '2' | |
negative-tests: | |
name: Negative Action Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test direct text (case-sensitive) | |
id: test-direct-text | |
continue-on-error: true | |
uses: ./ | |
with: | |
text: "Hey @PrOfEssortocat, I'm finished with my task" | |
keyphrase: '@professortocat' | |
case-sensitive: true | |
- name: Check output for direct text test | |
run: | | |
if [[ "${{ steps.test-direct-text.outcome }}" != "failure" ]]; then | |
echo "Expected the test to fail but it passed" | |
exit 1 | |
fi | |
if [[ "${{ steps.test-direct-text.outputs.occurrences }}" != "0" ]]; then | |
echo "Expected 0 occurrences but found ${{ steps.test-direct-text.outputs.occurrences }}" | |
exit 1 | |
fi | |
- name: Test text file (case-sensitive) | |
id: test-text-file | |
continue-on-error: true | |
uses: ./ | |
with: | |
text-file: ./__tests__/test-mixed-case.md | |
keyphrase: 'github' | |
minimum-occurrences: 3 | |
case-sensitive: true | |
- name: Check output for text file test | |
run: | | |
if [[ "${{ steps.test-text-file.outcome }}" != "failure" ]]; then | |
echo "Expected the test to fail but it passed" | |
exit 1 | |
fi | |
if [[ "${{ steps.test-text-file.outputs.occurrences }}" != "1" ]]; then | |
echo "Expected 1 occurrences but found ${{ steps.test-text-file.outputs.occurrences }}" | |
exit 1 | |
fi | |
- name: Test maximum-occurrences (negative case) | |
id: test-max-occurrences-negative | |
continue-on-error: true | |
uses: ./ | |
with: | |
text-file: ./__tests__/test-mixed-case.md | |
keyphrase: 'github' | |
maximum-occurrences: '2' | |
- name: Check output for maximum-occurrences test | |
run: | | |
if [[ "${{ steps.test-max-occurrences-negative.outcome }}" != "failure" ]]; then | |
echo "Expected the test to fail but it passed" | |
exit 1 | |
fi | |
if [[ "${{ steps.test-max-occurrences-negative.outputs.occurrences }}" != "3" ]]; then | |
echo "Expected 3 occurrences but found ${{ steps.test-max-occurrences-negative.outputs.occurrences }}" | |
exit 1 | |
fi |