-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (84 loc) · 2.65 KB
/
test.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Python Test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
inputs:
host:
description: "Host to Test"
type: string
required: false
default: "one.one.one.one"
ipv6:
description: "IPv6 to Test"
type: string
required: false
default: "2606:4700:4700::1111"
critical:
description: "Critical Level to Test"
type: string
required: false
default: "99"
warning:
description: "Warning Level to Test"
type: string
required: false
default: "99"
env:
COVERALLS_VERSION: "3.11"
TEST_HOST: ${{ github.event.inputs.host || 'one.one.one.one' }}
TEST_IPV6: ${{ github.event.inputs.ipv4 || '2606:4700:4700::1111' }}
CRITICAL: ${{ github.event.inputs.critical || '99' }}
WARNING: ${{ github.event.inputs.warning || '99' }}
jobs:
test:
name: Test
timeout-minutes: 5
if: ${{ !contains(github.event.head_commit.message, '#noci') }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
exclude:
- os: ubuntu-22.04
version: "3.6"
- os: ubuntu-20.04
version: "3.7"
- os: ubuntu-20.04
version: "3.8"
- os: ubuntu-20.04
version: "3.9"
- os: ubuntu-20.04
version: "3.10"
- os: ubuntu-20.04
version: "3.11"
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup Python ${{ matrix.version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: "Dependencies ${{ matrix.version }}"
run: |
python -m pip install --upgrade pip
pip install flake8 coverage
- name: "Lint ${{ matrix.version }}"
run: |
flake8 check_rbl.py
- name: "Test ${{ matrix.version }}"
run: |
coverage run check_rbl.py ||:
coverage run -a check_rbl.py -w $WARNING ||:
coverage run -a check_rbl.py -a $TEST_IPV4 -h $TEST_HOST ||:
coverage run -a check_rbl.py --ipv4 $TEST_IPV4 --ipv6 $TEST_IPV6 ||:
coverage run -a check_rbl.py -h invalid.com ||:
coverage run -a check_rbl.py -d -w $WARNING -c $CRITICAL -h $TEST_HOST
coverage run -a check_rbl.py -d -w $WARNING -c $CRITICAL -a $TEST_IPV6
coverage report -m
- name: "Coveralls"
if: ${{ matrix.version == env.COVERALLS_VERSION }}
uses: coverallsapp/github-action@v2