Skip to content

Commit

Permalink
Merge pull request #33 from andreygubarev/github-actions-prs
Browse files Browse the repository at this point in the history
added separate github actions for ansible and python linting and testing, removed them from python-package.yml
  • Loading branch information
andreygubarev authored Feb 21, 2024
2 parents 3bfaacc + bfac28c commit b808943
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 56 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion molecule_qemu/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b808943

Please sign in to comment.