-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (47 loc) · 1.79 KB
/
main.yaml
File metadata and controls
54 lines (47 loc) · 1.79 KB
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: CI
on:
push:
branches: [ master, github-action-slack-notification ]
pull_request:
branches: [ master ]
jobs:
build:
if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
name: Test on python ${{ matrix.python-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
python-version: [ 3.7, 3.8, 3.9, 3.10.x, 3.11 ]
steps:
- uses: actions/checkout@v4
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install packages
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-ci.txt ]; then pip install -r requirements-ci.txt; fi
- name: Run tests
run: coverage run --source=vwo -m pytest tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true
- name: Notification
if: always()
id: slack
uses: wingify/slack-github-action@v1.15.1-wingify
with:
channel-id: 'vwo-fs-fme-sdk-job-status'
slack-message: "<!here> Test on *Python-${{ matrix.python-version }}* and *${{ matrix.os }}* got *${{job.status}}* ${{job.status == 'success' && ':heavy_check_mark:' || ':x:'}} \nCommit: `${{github.event.head_commit.message}}`. \nCheck the latest build: https://github.com/wingify/vwo-fme-python-sdk/actions"
color: "${{job.status == 'success' && '#00FF00' || '#FF0000'}}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}