Standardize workflow triggers

This commit is contained in:
Nick Satterly 2023-03-20 08:58:54 +01:00
parent 64e013029d
commit faff3787c5
2 changed files with 28 additions and 24 deletions

View file

@ -1,8 +1,7 @@
name: CI Tests
name: Tests
on:
push:
branches: [ master, release/* ]
pull_request:
branches: [ master ]
@ -15,7 +14,7 @@ jobs:
services:
postgres:
image: postgres
image: postgres:11
env:
POSTGRES_DB: alerta
POSTGRES_USER: postgres
@ -30,12 +29,12 @@ jobs:
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@ -44,6 +43,10 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements-dev.txt
- name: Pre-commit hooks
id: hooks
run: |
pre-commit run -a --show-diff-on-failure
- name: Lint with flake8
id: lint
run: |
@ -62,7 +65,7 @@ jobs:
run: |
pytest -v webhooks/*/test*.py --cov=webhooks
- uses: act10ns/slack@v1
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@ -73,18 +76,18 @@ jobs:
services:
mongodb:
image: mongo
image: mongo:4.4
ports:
- 27017:27017
strategy:
matrix:
python-version: [3.6, 3.7]
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@ -93,6 +96,10 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements-dev.txt
- name: Pre-commit hooks
id: hooks
run: |
pre-commit run -a --show-diff-on-failure
- name: Lint with flake8
id: lint
run: |
@ -111,7 +118,7 @@ jobs:
run: |
pytest -v webhooks/*/test*.py --cov=webhooks
- uses: act10ns/slack@v1
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@ -139,7 +146,7 @@ jobs:
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost:8080/auth/saml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install packages
run: |
sudo apt-get update
@ -149,10 +156,10 @@ jobs:
libldap2-dev \
libsasl2-dev \
xmlsec1
- name: Set up Python 3.x
uses: actions/setup-python@v2
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.8'
architecture: 'x64'
- name: Install dependencies
id: install-deps
@ -165,9 +172,8 @@ jobs:
env:
DATABASE_URL: mongodb://127.0.0.1:27017/alerta
run: |
pylint -v integrations/*/*.py
- uses: act10ns/slack@v1
pytest tests/integration
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}

View file

@ -4,13 +4,11 @@ alerta
kombu
six
mock
mypy
pre-commit
mypy==1.0.1
pre-commit==2.20.0
PyJWT>=2.0.0
pylint
pylint==2.16.2
pytest>=5.4.3
pytest-cov
python-dotenv
requests_mock
twine
wheel