-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from mamercad/ansible-molecule-4
CI: Use Ansible Molecule for end-to-end testing (Rework)
- Loading branch information
Showing
21 changed files
with
1,476 additions
and
229 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.