diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d7c3956..90260ffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: python-version: "3.12" - name: Install python dependencies + id: deps run: | pip install -U pip wheel setuptools pip install -r requirements-test.txt @@ -51,6 +52,7 @@ jobs: ./run-qa-checks - name: Tests + if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} run: | mkdir -p ~/.ansible/roles ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.openwisp2 diff --git a/.yamllint.yml b/.yamllint.yml index debf6b60..f32af5a1 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -5,3 +5,15 @@ rules: line-length: max: 162 level: warning + truthy: + level: warning +ignore: | + .venv + venv + env + myenv + *.py + __pycache__ + .tox + .git + .github diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 05304a25..ad6019f1 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -6,10 +6,6 @@ dependency: role-file: molecule/resources/requirements.yml driver: name: docker -lint: | - set -e - yamllint . || true - ansible-lint || true platforms: - name: "${ROLE_NAME:-instance}-${MOLECULE_DISTRO}" image: "geerlingguy/docker-${MOLECULE_DISTRO}-ansible:${tag:-latest}" @@ -28,7 +24,9 @@ provisioner: verify: ../resources/verify.yml config_options: defaults: - stdout_callback: yaml + callbacks_enabled: + - ansible.builtin.default + result_format: yaml bin_ansible_callbacks: true inventory: host_vars: diff --git a/molecule/local/molecule.yml b/molecule/local/molecule.yml index 4ff9991d..aaba3b8a 100644 --- a/molecule/local/molecule.yml +++ b/molecule/local/molecule.yml @@ -6,10 +6,6 @@ dependency: role-file: molecule/resources/requirements.yml driver: name: docker -lint: | - set -e - yamllint . || true - ansible-lint || true platforms: - name: "openwisp2-ubuntu2404" image: "geerlingguy/docker-ubuntu2404-ansible:latest" @@ -60,7 +56,9 @@ provisioner: verify: ../resources/verify.yml config_options: defaults: - stdout_callback: yaml + callbacks_enabled: + - ansible.builtin.default + result_format: yaml bin_ansible_callbacks: true verifier: name: ansible diff --git a/molecule/resources/converge.yml b/molecule/resources/converge.yml index 05c9ffb7..a5dad8d3 100644 --- a/molecule/resources/converge.yml +++ b/molecule/resources/converge.yml @@ -32,7 +32,7 @@ - name: Install net-tools apt: name: - - net-tools + - net-tools - name: Remove the .dockerenv file file: diff --git a/run-qa-checks b/run-qa-checks index 65eeeddc..0953e96a 100755 --- a/run-qa-checks +++ b/run-qa-checks @@ -5,3 +5,7 @@ openwisp-qa-check --skip-isort \ --skip-flake8 \ --skip-black \ --skip-checkmigrations + +# Run Ansible linting +yamllint --strict --config-file .yamllint.yml . +ansible-lint diff --git a/vars/debian-13.yml b/vars/debian-13.yml index 8b9bcd87..12a0c099 100644 --- a/vars/debian-13.yml +++ b/vars/debian-13.yml @@ -1,6 +1,6 @@ --- -# Override variables for Debian 13 +# Override variables for Debian 13 openwisp2_ntp_pkg: ntpsec openwisp2_libgdk_pixbuf_pkg: libgdk-pixbuf-2.0-0