v1.1.358 #1929
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: Checks and Tests | |
on: | |
push: | |
pull_request: | |
env: | |
# Package name in the monorepo | |
test_app_package_name: test-test | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install | |
uses: ./.github/actions/install | |
with: | |
workspace-focus: ${{ env.test_app_package_name }} | |
- name: Check | |
run: yarn check | |
- name: Lint | |
run: yarn lint | |
tests: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install | |
uses: ./.github/actions/install | |
with: | |
workspace-focus: ${{ env.test_app_package_name }} | |
- name: Test | |
run: yarn test | |
notify: | |
needs: [checks, tests] | |
runs-on: ubuntu-latest | |
if: failure() | |
steps: | |
- name: Notify Discord on failure | |
run: | | |
echo "Checks or tests failed, sending message to Discord..." | |
curl -H "Content-Type: application/json" \ | |
-X POST \ | |
-d '{ | |
"content": "🚨 Checks or tests failed for commit `${{ github.sha }}` in [${{ github.repository }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}).\nSee the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." | |
}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |