diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-08-11 00:33:34 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-08-11 00:33:34 +0200 |
| commit | c8cdf4fc65e66130896b2a6e7af92e9b4a4d77aa (patch) | |
| tree | 01a4bab700fc8c8163c857d41c222ece90b25663 /.github/workflows | |
| parent | 6b20b109fd455ffa71351890a18940e7da326229 (diff) | |
Add ci testing
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0a00ba5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +--- +name: "CI" +'on': ["push", "pull_request"] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: pip3 install yamllint ansible-lint + - name: Copy example files + run: | + # Use example files for testing instead of encrypted files + for f in host_vars/*.example; do mv "$f" "$(echo "$f" | sed s/\.example//)"; done + - name: Run + run: | + yamllint . + ansible-lint + + playbook: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + molecule_distro: + - distro: archlinux + platform: "linux/amd64" + - distro: ubuntu + platform: "linux/amd64" + - distro: raspberrypi + platform: "linux/arm64/v8" + steps: + - name: Add ARM support + run: | + sudo apt-get install -y qemu-user-static binfmt-support + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: pip3 install ansible molecule molecule-plugins[docker] + - name: Copy example files + run: | + # Copy host_vars (from the .example files) + for f in host_vars/*.example; do cp "$f" "$(echo "$f" | sed s/\.example//)"; done + - name: Run + env: + PY_COLORS: 1 + ANSIBLE_FORCE_COLOR: 1 + run: >- + molecule --version && + ansible --version && + MOLECULE_COMMAND=${{ matrix.molecule_distro.command }} + MOLECULE_PLATFORM=${{ matrix.molecule_distro.platform }} + MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }} + molecule test |
