Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuSchl committed Sep 21, 2023
1 parent 98743de commit a17b2ec
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/back-dockerPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,17 @@ jobs:
id: data
run: |
awk 'NR>5' /tmp/coverage0.txt > /tmp/coverage1.txt
echo "embeds=[{\"type\":\"rich\",\"title\":\"$(grep -q "0 failed" /tmp/results.txt && echo "✅ All test are checked" || echo "❌ Errors with the test")\",\"description\":\"**Test back result:**\n$(tail -n 5 /tmp/results.txt | tr '\n' "&" | sed 's/&/\\n/g')\n**Coverage :**\",\"color\":$(grep -q "0 failed" /tmp/results.txt && echo 38912 || echo 16525609),\"fields\":[{\"name\":\"**Stmts**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 2 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Branches**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 3 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Functions**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 4 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Lines**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 5 | tr -d ' ')%\",\"inline\":true}]}]" >> "$GITHUB_OUTPUT"
echo "embeds=[{\"type\":\"rich\",\"title\":\"$(grep -q "failed" /tmp/results.txt && echo "❌ Errors with the test" || echo "✅ All test are checked")\",\"description\":\"**Test back result:**\n$(tail -n 5 /tmp/results.txt | tr '\n' "&" | sed 's/&/\\n/g')\n**Coverage :**\",\"color\":$(grep -q "failed" /tmp/results.txt && echo 16525609 || echo 38912),\"fields\":[{\"name\":\"**Stmts**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 2 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Branches**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 3 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Functions**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 4 | tr -d ' ')%\",\"inline\":true},{\"name\":\"**Lines**\",\"value\":\"$(grep 'All files' /tmp/coverage0.txt | cut -d '|' -f 5 | tr -d ' ')%\",\"inline\":true}]}]" >> "$GITHUB_OUTPUT"
# Green color 38912

- name: ERROR Send coverage to discord
uses: Ilshidur/action-discord@master
if: steps.tests.outcome == 'failure'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: GitHub
DISCORD_AVATAR: https://cdn.discordapp.com/avatars/1138225091528904714/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=100
DISCORD_EMBEDS: ${{ steps.data.outputs.embeds }}

- name: SUCCESS Send coverage to discord
uses: Ilshidur/action-discord@master
if: steps.tests.outcome == 'success'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "✅ All test are checked"

- name: Echo errors
if: steps.tests.outcome == 'failure'
run: |
Expand Down

0 comments on commit a17b2ec

Please sign in to comment.