Generate new fixtures #162
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- "**" | |
jobs: | |
eslint: | |
name: Eslint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
cache: "yarn" | |
- run: yarn install | |
- run: npx eslint . | |
prettier: | |
name: Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
cache: "yarn" | |
- run: yarn install | |
- run: npx prettier --check . | |
tests: | |
name: Run unit tests | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
cache: "yarn" | |
- run: yarn install | |
- run: yarn test | |
notification: | |
name: Slack notification | |
runs-on: ubuntu-latest | |
if: ${{ always() && github.actor != 'dependabot[bot]' }} | |
needs: [eslint, prettier, tests] | |
steps: | |
- name: Send notification | |
run: | | |
webhookUrl="${{ secrets.SLACK_WEBHOOK_URL }}" | |
successText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* completed successfully." | |
failureText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* failed." | |
cancelledText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* was cancelled.😥" | |
status="${{ (contains(needs.*.result, 'cancelled') && 'cancelled') || (contains(needs.*.result, 'failure') && 'failure') || 'success' }}" | |
if [ "$status" = 'success' ]; then | |
color='good' | |
text=$successText | |
elif [ "$status" = 'failure' ]; then | |
color='danger' | |
text=$failureText | |
elif [ "$status" = "cancelled" ]; then | |
color='warning' | |
text=$cancelledText | |
fi | |
curl "$webhookUrl" -X "POST" --header "Content-Type: application/json" \ | |
--data "{attachments: [{text: \"$text\", color: \"$color\"}]}" |