diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml new file mode 100644 index 0000000..d52d50c --- /dev/null +++ b/.github/workflows/ansible-lint.yml @@ -0,0 +1,24 @@ +name: Ansible - Lint + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + lint-ansible: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install ansible-lint + + - name: Lint with ansible-lint + run: ansible-lint -v diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml new file mode 100644 index 0000000..7428109 --- /dev/null +++ b/.github/workflows/ansible-test.yml @@ -0,0 +1,26 @@ +name: Ansible - Test + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -yq --no-install-recommends mkisofs qemu-system-x86 qemu-utils + + - name: Run test + run: make test-platform-amd64 diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml new file mode 100644 index 0000000..282a0c4 --- /dev/null +++ b/.github/workflows/python-lint.yml @@ -0,0 +1,24 @@ +name: Python Package - Lint + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + lint-python: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install pycodestyle + + - name: Lint with pycodestyle + run: python -m pycodestyle molecule_qemu diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-release.yml similarity index 60% rename from .github/workflows/python-package.yml rename to .github/workflows/python-release.yml index 6581011..05f2d76 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-release.yml @@ -1,64 +1,17 @@ -name: Python Package +name: Python Package - Release + +on: + push: + branches: + - main + tags: + - 'v*.*.*' -on: [push] permissions: contents: read jobs: - lint-ansible: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Install dependencies - run: pip install ansible-lint - - - name: Lint with ansible-lint - run: ansible-lint -v - - lint-python: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Install dependencies - run: pip install pycodestyle - - - name: Lint with pycodestyle - run: python -m pycodestyle molecule_qemu - - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -yq --no-install-recommends mkisofs qemu-system-x86 qemu-utils - - - name: Run test - run: make test-platform-amd64 - build: runs-on: ubuntu-latest needs: [lint-ansible, lint-python, test] diff --git a/molecule_qemu/playbooks/create.yml b/molecule_qemu/playbooks/create.yml index 9ed63e8..63be9dd 100644 --- a/molecule_qemu/playbooks/create.yml +++ b/molecule_qemu/playbooks/create.yml @@ -130,7 +130,7 @@ - name: Check kvm support when: ansible_system == 'Linux' - ansible.builtin.shell: (egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') && test -e /dev/kvm + ansible.builtin.shell: (egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') && test -r /dev/kvm && test -w /dev/kvm register: kvm_support changed_when: false ignore_errors: true