fix(ci): fix molecule

This commit is contained in:
Timothy Stewart
2024-01-22 18:13:00 -06:00
parent bdc5d0970d
commit 01d4bb8f8a
3 changed files with 26 additions and 35 deletions

View File

@@ -21,14 +21,14 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # caching pip dependencies cache: 'pip' # caching pip dependencies
- name: Cache Ansible # - name: Cache Ansible
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0 # uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
id: cache-ansible # id: cache-ansible
with: # with:
path: ~/.ansible/collections # path: ~/.ansible/collections
key: ansible-${{ hashFiles('collections/requirements.yml') }} # key: ansible-${{ hashFiles('collections/requirements.yml') }}
restore-keys: | # restore-keys: |
ansible- # ansible-
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -40,12 +40,12 @@ jobs:
python3 -m pip install -r requirements.txt python3 -m pip install -r requirements.txt
echo "::endgroup::" echo "::endgroup::"
- name: Install ansible dependencies # - name: Install ansible dependencies
if: steps.cache-ansible.outputs.cache-hit != 'true' # only run if false since this is just a cache step # if: steps.cache-ansible.outputs.cache-hit != 'true' # only run if false since this is just a cache step
run: | # run: |
echo "::group::Install Ansible role requirements from collections/requirements.yml" # echo "::group::Install Ansible role requirements from collections/requirements.yml"
ansible-galaxy install -r collections/requirements.yml # ansible-galaxy install -r collections/requirements.yml
echo "::endgroup::" # echo "::endgroup::"
- name: Cache Vagrant boxes - name: Cache Vagrant boxes
id: cache-vagrant id: cache-vagrant

View File

@@ -37,10 +37,6 @@ jobs:
python3 -m pip install -r requirements.txt python3 -m pip install -r requirements.txt
echo "::endgroup::" echo "::endgroup::"
echo "::group::Install Ansible role requirements from collections/requirements.yml"
ansible-galaxy install -r collections/requirements.yml
echo "::endgroup::"
- name: Run pre-commit - name: Run pre-commit
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # 3.0.0 uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # 3.0.0

View File

@@ -22,11 +22,18 @@ jobs:
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
- name: Restore Ansible cache # - name: Restore Ansible cache
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0 # uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
with: # with:
path: ~/.ansible/collections # path: ~/.ansible/collections
key: ansible-${{ hashFiles('collections/requirements.yml') }} # key: ansible-${{ hashFiles('collections/requirements.yml') }}
- name: Configure VirtualBox
run: |-
sudo mkdir -p /etc/vbox
cat <<EOF | sudo tee -a /etc/vbox/networks.conf > /dev/null
* 192.168.30.0/24
* fdad:bad:ba55::/64
EOF
- name: Set up Python ${{ env.PYTHON_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # 2.3.3 uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # 2.3.3
@@ -56,14 +63,6 @@ jobs:
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }} key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
fail-on-cache-miss: true fail-on-cache-miss: true
- name: Configure VirtualBox
run: |-
sudo mkdir -p /etc/vbox
cat <<EOF | sudo tee -a /etc/vbox/networks.conf > /dev/null
* 192.168.30.0/24
* fdad:bad:ba55::/64
EOF
- name: Install dependencies - name: Install dependencies
run: | run: |
echo "::group::Upgrade pip" echo "::group::Upgrade pip"
@@ -74,10 +73,6 @@ jobs:
python3 -m pip install -r requirements.txt python3 -m pip install -r requirements.txt
echo "::endgroup::" echo "::endgroup::"
echo "::group::Install Ansible role requirements from collections/requirements.yml"
ansible-galaxy install -r collections/requirements.yml
echo "::endgroup::"
- name: Test with molecule - name: Test with molecule
run: molecule test --scenario-name ${{ matrix.scenario }} run: molecule test --scenario-name ${{ matrix.scenario }}
timeout-minutes: 90 timeout-minutes: 90