|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: checkout |
| 15 | + uses: actions/checkout@v2 |
| 16 | + |
| 17 | + - name: set outputs |
| 18 | + id: vars |
| 19 | + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" |
| 20 | + |
| 21 | + - name: start build notification |
| 22 | + uses: appleboy/telegram-action@master |
| 23 | + with: |
| 24 | + to: ${{ secrets.TELEGRAM_CHAT }} |
| 25 | + token: ${{ secrets.TELEGRAM_TOKEN }} |
| 26 | + disable_web_page_preview: true |
| 27 | + format: html |
| 28 | + message: | |
| 29 | + ⏳ <a href="${{ github.server_url }}/${{ github.repository }}"><b>${{ github.repository }}</b></a> |
| 30 | +
|
| 31 | + ${{ github.workflow }} |
| 32 | +
|
| 33 | + by: ${{ github.actor }} |
| 34 | + branch: ${{ github.ref }} |
| 35 | + commit: ${{ github.event.head_commit.message }} |
| 36 | + sha: ${{ steps.vars.outputs.sha_short }} |
| 37 | +
|
| 38 | + <a href="${{ github.event.head_commit.url }}">link</a> |
| 39 | +
|
| 40 | + - name: install tools from asdf config |
| 41 | + uses: ai/asdf-cache-action@v1 |
| 42 | + |
| 43 | + - name: install dependencies |
| 44 | + run: pnpm install |
| 45 | + |
| 46 | + - name: build packages |
| 47 | + run: pnpm build |
| 48 | + |
| 49 | + - name: test |
| 50 | + run: pnpm test |
| 51 | + |
| 52 | + - name: finish build notification |
| 53 | + uses: appleboy/telegram-action@master |
| 54 | + if: always() |
| 55 | + with: |
| 56 | + to: ${{ secrets.TELEGRAM_CHAT }} |
| 57 | + token: ${{ secrets.TELEGRAM_TOKEN }} |
| 58 | + disable_web_page_preview: true |
| 59 | + format: html |
| 60 | + message: | |
| 61 | + ${{ job.status == 'success' && '✅' || '🆘' }} <a href="${{ github.server_url }}/${{ github.repository }}"><b>${{ github.repository }}</b></a> |
| 62 | +
|
| 63 | + ${{ github.workflow }} |
| 64 | +
|
| 65 | + by: ${{ github.actor }} |
| 66 | + branch: ${{ github.ref }} |
| 67 | + commit: ${{ github.event.head_commit.message }} |
| 68 | + sha: ${{ steps.vars.outputs.sha_short }} |
| 69 | +
|
| 70 | + <a href="${{ github.event.head_commit.url }}">link</a> |
0 commit comments