From 185dbf793a3766150688d7db641a34f80c767e23 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Thu, 7 Dec 2023 22:05:17 +0100 Subject: [PATCH] test workflow (#41) * issue #15 : test workflow * issue #15 : test workflow * issue #15 : test workflow * issue #15 : test workflow - debug pip packages * issue #15 : test workflow - debug pip packages * issue #15 : test workflow - use new action * issue #15 : test workflow - use new action * issue #15 : test workflow - fix ansible_python_interpreter * Revert "issue #15 : test workflow - use new action" This reverts commit b0e0caa0bf3ad87682c4a3ac1da62a824ed4c171. * Revert "issue #15 : test workflow - use new action" This reverts commit 7a27425a6d0e135a1692488632960855a1cc7d41. * issue #15 : test workflow - ok * issue #15 : test badge --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ README.md | 1 + test/test.yml | 1 + 3 files changed, 28 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..74bc006 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +--- +name: ansible test +on: + pull_request: + push: + schedule: + - cron: "45 5 * * 2" + +jobs: + build: + name: ansible test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: set up python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: install requirements + run: | + python -m pip install --upgrade pip + pip install ansible ansible-core lxml + - name: run ansible test + working-directory: ./test + run: | + ansible-playbook test.yml diff --git a/README.md b/README.md index 187fff3..91185cd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![ansible-lint](https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense/actions/workflows/lint.yml/badge.svg?branch=linted)](https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense/actions/workflows/lint.yml) +[![ansible test](https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense/actions/workflows/test.yml/badge.svg)](https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense/actions/workflows/test.yml) ansible-opnsense ========= diff --git a/test/test.yml b/test/test.yml index a36a103..ab7fd04 100644 --- a/test/test.yml +++ b/test/test.yml @@ -3,6 +3,7 @@ - name: run test hosts: testhosts vars: + ansible_python_interpreter: "/usr/bin/env python" # REQUIRED for guthub action config_path: test/{{ inventory_hostname }}.xml local_config_path: cfg/{{ inventory_hostname }}.xml tasks: