Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tech] add notification to slack #775

Merged
merged 9 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
- uses: actions/checkout@master
- name: Check formatting
run: make format
- name: slack notification (the job has failed)
if: failure() && github.ref == 'ref/head/master'
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model CI` requires your attention!",
"text":" :warning: Formatting check failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'

clippy:
name: Analyzing code with Clippy
Expand All @@ -24,6 +33,15 @@ jobs:
- uses: actions/checkout@master
- name: Linting
run: make lint
- name: slack notification (the job has failed)
if: failure() && github.ref == 'ref/head/master'
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model CI` requires your attention!",
"text":" :warning: Analyzing code with Clippy failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'

audit:
name: Audits
Expand All @@ -36,6 +54,15 @@ jobs:
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: slack notification (the job has failed)
if: failure() && github.ref == 'ref/head/master'
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model CI` requires your attention!",
"text":" :warning: Audits failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'

tests:
name: Tests
Expand All @@ -49,6 +76,15 @@ jobs:
run: apt update && apt install --yes libxml2-utils
- name: Run tests with and without features
run: make test
- name: slack notification (the job has failed)
if: failure() && github.ref == 'ref/head/master'
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model CI` requires your attention!",
"text":" :warning: Tests failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'

coverage:
name: Code coverage
Expand All @@ -74,3 +110,12 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: slack notification (the job has failed)
if: failure() && github.ref == 'ref/head/master'
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model CI` requires your attention!",
"text":" :warning: Code coverage failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ jobs:
with:
command: publish
args: --all-features
- name: slack notification (the job has failed)
if: failure()
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model Publish` requires your attention!",
"text":" :warning: Publish failed!","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'