-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (50 loc) · 1.56 KB
/
test_odin_control.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
name: Test odin-control
on:
- push
- pull_request
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions coverage
- name: Test with tox
run: tox
- name: Merge tox env specific coverage files
run: |
coverage combine
if [[ "${{ matrix.python-version }}" == 2.7* ]]; then
export COVERAGE_RC=.coveragerc-py27
else
export COVERAGE_RC=.coveragerc
fi
coverage xml --rcfile=$COVERAGE_RC
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.python-version }}
fail_ci_if_error: false
notify:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Slack Notification on completion
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: odin-control-notify
SLACK_COLOR: ${{ needs.build_and_test.result }}
SLACK_ICON: https://avatars.githubusercontent.com/odin-detector?size=48
SLACK_TITLE: "odin-control CI tests completed: ${{ needs.build_and_test.result }}"
SLACK_USERNAME: odin-detector
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}