Update .npmignore #5
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: Test | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| test: | |
| if: github.actor != 'dependabot[bot]' | |
| env: | |
| RUN_COVERAGE_FOR: 22.17.0 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22.17.0] | |
| steps: | |
| - name: Setup Node ${{ matrix.node-version }} | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint | |
| run: npx eslint . | |
| - name: Install tools | |
| run: npm install -g coveralls nyc | |
| - name: Test | |
| env: | |
| CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
| CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| run: | | |
| if [ "${{ matrix.node-version }}" == "${RUN_COVERAGE_FOR}" ] | |
| then | |
| npm run coveralls | |
| else | |
| npm test | |
| fi | |
| - if: always() | |
| name: Send Slack notification | |
| run: | | |
| # Set common variables | |
| COMMIT_AUTHOR=$(git log -1 --format='%an' ${{ github.sha }} | sed "s/'/'\\\\''/g") | |
| COMMIT_MSG=$(git log -1 --pretty=format:%s ${{ github.sha }} | sed "s/'/'\\\\''/g" | head -c 100) | |
| COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}" | |
| GH_RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) | |
| SLACK_CHANNEL=$(echo "#${{ github.event.repository.name }}" | sed 's/\./-/g') | |
| # Set status-specific variables | |
| if [ "${{ job.status }}" == "success" ]; then | |
| HEADER_TEXT=":white_check_mark: Tests passed for ${{ github.event.repository.name }}" | |
| else | |
| HEADER_TEXT=":x: Tests failed for ${{ github.event.repository.name }}" | |
| fi | |
| # Send Slack notification | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data '{ | |
| "blocks": [ | |
| { | |
| "text": { | |
| "text": "'"${HEADER_TEXT}"'", | |
| "type": "plain_text" | |
| }, | |
| "type": "header" | |
| }, | |
| { | |
| "text": { | |
| "text": "*Author:* '"${COMMIT_AUTHOR}"'\n*Branch:* ${{ github.ref_name }}\n*Commit:* <'"${COMMIT_URL}"'|'"${SHORT_SHA}"'>\n*Message:* '"${COMMIT_MSG}"'", | |
| "type": "mrkdwn" | |
| }, | |
| "type": "section" | |
| }, | |
| { | |
| "elements": [ | |
| { | |
| "text": { | |
| "text": "Code Coverage", | |
| "type": "plain_text" | |
| }, | |
| "type": "button", | |
| "url": "https://coveralls.io/github/${{ github.repository }}" | |
| }, | |
| { | |
| "text": { | |
| "text": "GitHub Action", | |
| "type": "plain_text" | |
| }, | |
| "type": "button", | |
| "url": "'"${GH_RUN_URL}"'" | |
| } | |
| ], | |
| "type": "actions" | |
| } | |
| ], | |
| "channel": "'"${SLACK_CHANNEL}"'", | |
| "icon_url": "https://mercatalyst.com/apple-touch-icon.png", | |
| "username": "Mercatalyst" | |
| }' ${{ secrets.SLACK_WEBHOOK_URL }} |