diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..91efca0 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 + - 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' \ No newline at end of file