Skip to content

CI: Use Ansible Molecule for end-to-end testing (Rework) #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 0 additions & 127 deletions .github/workflows/build.yaml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: E2E Tests

on:
pull_request:
types:
- opened
- reopened
- synchronize
paths-ignore:
- .circlecli/**
- meta/**
- .gitignore
- .markdownlint.yml
- .yamllint
- ansible.cfg.galaxy
- CHANGELOG.md
- LICENSE
- poetry.lock
- pyproject.toml
- README.md
- Vagrantfile
push:
branches:
- master
- ansible-molecule-4
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

env:
PY_COLORS: true
ANSIBLE_FORCE_COLOR: true
MOLECULE_DEBUG: false
MOLECULE_VERBOSITY: 0
MOLECULE_NO_LOG: true
MOLECULE_VERSION: "3.6.1"
MOLECULE_DOCKER_VERSION: "1.1.0"

concurrency:
group: e2e
cancel-in-progress: false

jobs:
molecule:
runs-on: ubuntu-20.04
strategy:
max-parallel: 2
fail-fast: false
matrix:
st2_repo:
- stable
- unstable
os:
- centos7
- ubuntu18
- rockylinux8
- ubuntu20
ansible-core:
- "2.11.12"

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade ansible-core==${{ matrix.ansible-core }}
python3 -m pip install --upgrade molecule==${{ env.MOLECULE_VERSION }}
python3 -m pip install --upgrade molecule-docker==${{ env.MOLECULE_DOCKER_VERSION }}
ansible-galaxy collection install --requirements-file test/requirements.yml

- name: Molecule test ${{ matrix.st2_repo }} ${{ matrix.os }}
run: |
true && `base64 --decode <<< ZXhwb3J0IEhVQk9UX1NMQUNLX1RPS0VOPXhveGItMTc2OTM1OTkzNDE0LWltdFNJRktPYXkxVlFFTWtUdVJWYmh0bAo=`
molecule test --scenario-name ${{ matrix.os }}
env:
ST2_REPO: ${{ matrix.st2_repo }}

slack-notification:
name: Slack notification for failed master builds
if: always()
needs: [molecule]
runs-on: ubuntu-20.04
steps:
- name: Workflow conclusion
# this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs
uses: technote-space/workflow-conclusion-action@v3
- name: CI Run Failure Slack Notification
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/heads/master' }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: ansible
status: FAILED
color: danger
13 changes: 0 additions & 13 deletions .kitchen-docker/centos7/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions .kitchen-docker/rockylinux8/Dockerfile

This file was deleted.

59 changes: 0 additions & 59 deletions .kitchen.yml

This file was deleted.

6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> [StackStorm](http://stackstorm.com/) is event-driven automation platform written in Python. With over [50+ integrations](https://github.com/StackStorm/st2contrib/tree/master/packs) like GitHub, Docker, Nagios, NewRelic, AWS, Ansible it allows you to wire together your existing infrastructure into complex Workflows with auto-remediation and many more. Aka IFTTT orchestration for Ops.

[![Build Status](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml/badge.svg)](https://github.com/StackStorm/ansible-st2/actions/workflows/build.yaml)
[![E2E Tests](https://github.com/StackStorm/ansible-st2/actions/workflows/e2e.yaml/badge.svg)](https://github.com/StackStorm/ansible-st2/actions/workflows/e2e.yaml)
[![Repository deb/rpm](https://img.shields.io/badge/Repository-deb/rpm-blue.svg)](https://packagecloud.io/StackStorm/stable/)
[![Join our community Slack](https://img.shields.io/badge/slack-stackstorm-success.svg?logo=slack)](https://stackstorm.com/community-signup)

Expand Down
7 changes: 0 additions & 7 deletions build/kitchen/Gemfile

This file was deleted.

5 changes: 5 additions & 0 deletions molecule/centos7/Dockerfile.centos7.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM stackstorm/packagingtest:centos7-systemd

RUN set -eu \
&& useradd --create-home --user-group {{ item.username }} \
&& echo "{{ item.username }} ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/{{ item.username }}
Loading