Skip to content

Commit

Permalink
Merge molecule default and ci scenarios (#27)
Browse files Browse the repository at this point in the history
* Removed ansible pip package as it already exist on the GH runners
* Remove workflow default working directory

---------

Co-authored-by: Benjamin Cook <[email protected]>
  • Loading branch information
bcook254 and Benjamin Cook authored May 13, 2024
1 parent aee7ce6 commit bdbed0e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 123 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ name: ci
branches:
- main

defaults:
run:
working-directory: 'bcook254.adguardhome'

jobs:

lint:
Expand All @@ -18,13 +14,6 @@ jobs:
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'bcook254.adguardhome'

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: python -m pip install yamllint
Expand All @@ -33,7 +22,7 @@ jobs:
run: yamllint .

molecule:
name: Molecule Test
name: Molecule Test (${{ matrix.platform.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -64,21 +53,28 @@ jobs:
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'bcook254.adguardhome'

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: python -m pip install ansible molecule molecule-plugins[docker] docker
run: python -m pip install molecule molecule-plugins[docker]

- name: Run Molecule tests.
run: molecule test --driver-name docker --scenario-name ci
run: molecule test --driver-name docker
env:
PLATFORM_NAME: ${{ matrix.platform.name }}
PLATFORM_IMAGE: ${{ matrix.platform.image }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

check:
name: Molecule Tests
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [molecule]
steps:
- name: Exit on failure
if: ${{ needs.molecule.result == 'failure' }}
shell: bash
run: exit 1
- name: Exit
shell: bash
run: exit 0
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ jobs:
with:
path: 'bcook254.adguardhome'

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Ansible.
run: python3 -m pip install ansible-core

- name: Trigger a new import on Galaxy.
run: >-
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }}
Expand Down
6 changes: 0 additions & 6 deletions molecule/ci/converge.yml

This file was deleted.

29 changes: 0 additions & 29 deletions molecule/ci/molecule.yml

This file was deleted.

26 changes: 0 additions & 26 deletions molecule/ci/prepare.yml

This file was deleted.

2 changes: 0 additions & 2 deletions molecule/ci/requirements.yml

This file was deleted.

29 changes: 0 additions & 29 deletions molecule/ci/verify.yml

This file was deleted.

4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ dependency:
driver:
name: podman
platforms:
- name: ${MOLECULE_DISTRO:-ubuntu2404}
image: docker.io/geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2404}-ansible:latest
- name: ${PLATFORM_NAME:-ubuntu2404}
image: ${PLATFORM_IMAGE:-"docker.io/geerlingguy/docker-ubuntu2404-ansible:latest"}
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down

0 comments on commit bdbed0e

Please sign in to comment.