forked from tim/k3s-ansible
ci(runner): restore isolated Molecule CI
- Scope VirtualBox cleanup to repository-owned Molecule resources\n- Route lint to hosted runners and harden self-hosted workflow execution\n- Add diagnostics, fixture coverage, and reproducible lint validation
This commit is contained in:
committed by
Techno Tim
parent
2fad0a8db6
commit
29b7aa1b72
@@ -5,15 +5,30 @@ on:
|
||||
jobs:
|
||||
molecule:
|
||||
name: cache
|
||||
runs-on: self-hosted
|
||||
runs-on: [self-hosted, linux, x64, k3s-ci, virtualbox, nested-virt]
|
||||
env:
|
||||
PYTHON_VERSION: "3.11"
|
||||
VAGRANT_DEFAULT_PROVIDER: virtualbox
|
||||
VAGRANT_HOME: ${{ github.workspace }}/.vagrant-home
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Check nested VirtualBox platform
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
grep -Eq 'vmx|svm' /proc/cpuinfo
|
||||
test -c /dev/kvm
|
||||
test -c /dev/vboxdrv
|
||||
VBoxManage --version
|
||||
vagrant --version
|
||||
test -r /etc/vbox/networks.conf
|
||||
test "$(stat -c '%u' /etc/vbox/networks.conf)" -eq 0
|
||||
free -h
|
||||
df -Pk "${RUNNER_TEMP}"
|
||||
|
||||
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
||||
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # 5.3.0
|
||||
@@ -25,12 +40,12 @@ jobs:
|
||||
id: cache-vagrant
|
||||
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2
|
||||
with:
|
||||
lookup-only: true #if it exists, we don't need to restore and can skip the next step
|
||||
lookup-only: true # if it exists, we don't need to restore and can skip the next step
|
||||
path: |
|
||||
~/.vagrant.d/boxes
|
||||
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
|
||||
.vagrant-home/boxes
|
||||
key: vagrant-boxes-${{ runner.os }}-${{ runner.arch }}-virtualbox-7.2-vagrant-2.4-${{ hashFiles('**/molecule.yml') }} # yamllint disable-line rule:line-length
|
||||
restore-keys: |
|
||||
vagrant-boxes
|
||||
vagrant-boxes-${{ runner.os }}-${{ runner.arch }}-virtualbox-7.2-vagrant-2.4-
|
||||
|
||||
- name: Download Vagrant boxes for all scenarios
|
||||
# To save some cache space, all scenarios share the same cache key.
|
||||
|
||||
Reference in New Issue
Block a user