feat: added molecule tests
Some checks failed
Molecule Tests / molecule-tests (pull_request) Failing after 1m52s
Some checks failed
Molecule Tests / molecule-tests (pull_request) Failing after 1m52s
This commit is contained in:
43
.gitea/workflows/molecule-tests.yml
Normal file
43
.gitea/workflows/molecule-tests.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
#SPDX-License-Identifier: GPL-3.0-only
|
||||
---
|
||||
name: Molecule Tests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 7 * * 1' # Every Monday at 07:00 UTC
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
molecule-tests:
|
||||
runs-on: fedora-latest
|
||||
steps:
|
||||
- name: Add ~/.local/bin to PATH
|
||||
run: echo "$HOME/.local/bin" >> "$GITEA_PATH"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: ansible_role_mail
|
||||
|
||||
- name: Install Molecule
|
||||
run: pip install ansible molecule molecule-plugins[podman]
|
||||
|
||||
- name: Install Ansible collections
|
||||
run: ansible-galaxy collection install containers.podman
|
||||
|
||||
- name: Run Molecule tests
|
||||
working-directory: ansible_role_mail
|
||||
run: molecule test
|
||||
|
||||
- name: Tag latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
working-directory: ansible_role_mail
|
||||
run: |
|
||||
git config user.name "giabot"
|
||||
git config user.email "bot@mail.gianet.us"
|
||||
git remote set-url origin "https://giabot:${{ secrets.GITEA_TOKEN }}@gianet.us/engineering/ansible_role_mail.git"
|
||||
git tag -f latest
|
||||
git push -f origin latest
|
||||
Reference in New Issue
Block a user