-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1046b33
Add Molecule for testing (remove Kitchen)
mamercad a4a0049
Remove `community.docker`
mamercad 8ac4690
Combine Python 3.6 and 3.8
mamercad 2551889
Add `community.docker`
mamercad 7ca78e3
Typo
mamercad bcc55ee
Reworking into repo-os
mamercad cf9dd87
Comment out 3.6
mamercad 2bd773c
Move requirements under test
mamercad 79fc58e
Iterate on the matrix
mamercad 1b677cc
Change `$HUBOT_SLACK_TOKEN` method
mamercad 0eef0bb
Use system Python
mamercad 7893dc4
Remove the changelog
mamercad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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" | ||
mamercad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.