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

Feature slack notification #29

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }}
run: |
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y swig libexiv2-dev libboost-python-dev
python -m pip install --upgrade pip
pip install pytest
Comment on lines +32 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python -m pip install --upgrade pip
pip install pytest
python3 -m pip install --upgrade pip
python3 -m pip install pytest

It's always a good practice to use python3 instead of python when invoking python3 intepreter.

- name: test
env:
GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }}
run: |
pytest
notification-success:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v2

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: 'success'

notification-failure:
runs-on: ubuntu-latest
needs: test
if: ${{ failure() }}

steps:
- uses: actions/checkout@v2

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: 'failure'