Simplify molecule tests

"Upgrade" path includes multiple paths anyway:
- installing the latest official release package
- builing the current PR from source
- upgrading between the two versions
This commit is contained in:
Fabian Koller
2021-01-23 22:09:56 +01:00
parent 0d19957d4b
commit bfbdfe857f
9 changed files with 100 additions and 195 deletions

View File

@@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
# https://molecule.readthedocs.io/en/latest/ci.html#github-actions
test-fresh:
test:
runs-on: ubuntu-latest
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
@@ -26,36 +26,15 @@ jobs:
docker --version
molecule --version
python --version
- name: Test fresh installation with molecule
- name: Test installation/build/upgrade with molecule
run: |
cd ansible
molecule test -s fresh
working-directory: "${{ github.repository }}"
test-update:
runs-on: ubuntu-latest
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
steps:
- name: Check out the codebase
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"
- name: Set up Python
uses: actions/setup-python@v2
- name: Set up Docker
uses: docker-practice/actions-setup-docker@master
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install molecule[ansible,docker] jmespath
ansible --version
docker --version
molecule --version
python --version
- name: Test release update with molecule
run: |
cd ansible
molecule test -s update
molecule create
molecule verify
molecule converge
molecule idempotence
molecule verify
molecule destroy
working-directory: "${{ github.repository }}"
# # https://galaxy.ansible.com/docs/contributing/importing.html
# release: