Skip to content

Commit

Permalink
Update workflows and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slashpai committed Dec 27, 2020
1 parent 42bf958 commit 97cf098
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ansible-lint.yml

This file was deleted.

18 changes: 13 additions & 5 deletions .github/workflows/molecule.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
name: molecule-test
name: build

on: [push, pull_request]

jobs:
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Lint Ansible Playbook
uses: ansible/ansible-lint-action@master
with:
targets: |
*/*.yml
molecule:
runs-on: ubuntu-latest
steps:
Expand All @@ -19,10 +30,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
pip install --no-cache-dir molecule
pip install --no-cache-dir molecule[docker,lint]
pip install git+git://github.com/ansible-community/molecule-inspec.git@master
# pip install molecule-inspec
python -m pip install --no-cache-dir -r requirements.txt
- name: Molecule test
run: |
molecule --debug test
2 changes: 0 additions & 2 deletions .github/workflows/md-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on: [push, pull_request]

jobs:
md-links:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@master
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Ansible role prometheus-msteams

[![ansible lint](https://github.com/slashpai/ansible-prometheus-msteams/workflows/ansible%20lint/badge.svg)](https://github.com/slashpai/ansible-prometheus-msteams/actions?query=workflow%3Aansible-lint)
[![build](https://github.com/slashpai/ansible-prometheus-msteams/workflows/build/badge.svg)](https://github.com/slashpai/ansible-prometheus-msteams/actions?query=workflow%3Abuild)
[![markdown links](https://github.com/slashpai/ansible-prometheus-msteams/workflows/md-links/badge.svg)](https://github.com/slashpai/ansible-prometheus-msteams/actions?query=workflow%3AMD-links)
[![molecule test](https://github.com/slashpai/ansible-prometheus-msteams/workflows/molecule-test/badge.svg)](https://github.com/slashpai/ansible-prometheus-msteams/actions?query=workflow%3Amolecule-test)
[![Ansible Role](https://img.shields.io/badge/ansible%20role-slashpai.ansible_prometheus_msteams-purple.svg)](https://galaxy.ansible.com/slashpai/ansible_prometheus_msteams)
[![GitHub tag](https://img.shields.io/github/v/tag/slashpai/ansible-prometheus-msteams.svg?sort=semver)](https://github.com/slashpai/ansible-prometheus-msteams/tags)


## ansible-prometheus-msteams

To install and configure [prometheus-msteams](https://github.com/prometheus-msteams/prometheus-msteams) for sending notifications from [alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) to [microsoft teams](https://www.microsoft.com/en-in/microsoft-365/microsoft-teams/group-chat-software)
Expand Down
1 change: 1 addition & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible

verifier:
name: inspec
6 changes: 6 additions & 0 deletions molecule/default/tests/test_default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
it { should be_running }
end

describe processes('prometheus_msteams') do
it { should exist }
its('users') { should eq ['prometheus_msteams'] }
its('commands') { should eq ['/usr/local/bin/prometheus_msteams -teams-request-uri alertmanager -config-file /etc/prometheus_msteams/config.yaml -template-file /etc/prometheus_msteams/default-message-card.tmpl'] }
end

describe command('curl http://localhost:2000') do
its('stdout') { should include 'message":"Not Found"' }
its('exit_status') { should eq 0 }
Expand Down
14 changes: 8 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
molecule==3.2.1
molecule-docker==0.2.4
molecule-inspec==1.0
ansible==2.9.6
ansible-lint==4.3.5
docker==4.4.1
molecule
molecule-docker
# since this version has bug for log message
# molecule-inspec==1.0
git+git://github.com/ansible-community/molecule-inspec.git@master
ansible
ansible-lint
docker

0 comments on commit 97cf098

Please sign in to comment.