-
Notifications
You must be signed in to change notification settings - Fork 255
64 lines (55 loc) · 1.72 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: tests
on:
push:
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- '.readthedocs.yaml'
- 'requirements-mkdocs.txt'
- 'README.md'
jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
env:
CONSUMER_KEY: ${{ secrets.consumer_key }}
CONSUMER_SECRET: ${{ secrets.consumer_secret }}
ACCESS_TOKEN: ${{ secrets.access_token }}
ACCESS_TOKEN_SECRET: ${{ secrets.access_token_secret }}
BEARER_TOKEN: ${{ secrets.bearer_token }}
SKIP_ACADEMIC_PRODUCT_TRACK: true
run: python setup.py test
- name: Ensure packages can be built
run: |
python -m pip install wheel
python setup.py sdist bdist_wheel
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: docnow-build
SLACK_ICON_EMOJI: ":test-tube:"
SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}"
SLACK_MESSAGE: "Tests Results: ${{ job.status }}"