Skip to content

Test Modules

Test Modules #76

Workflow file for this run

name: Test Modules
on:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
integration-test:
environment: test
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ansible/ansible_collections/devolutions/dvls
steps:
- name: Checkout code
uses: actions/checkout@v4
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '22'
# - name: Install dependencies
# run: npm install
- name: Login to Devolutions Server
uses: Devolutions/actions-public/dvls-login@v1
with:
server_url: 'https://dvls-ops.devolutions.com'
app_key: ${{ secrets.DVLS_APP_KEY }}
app_secret: ${{ secrets.DVLS_APP_SECRET }}
# Now you can use other Devolutions Server actions with the token
- name: Get Secret
uses: Devolutions/actions-public/dvls-get-secret-entry@v1
with:
server_url: 'https://dvls-ops.devolutions.com'
token: ${{ env.DVLS_TOKEN }}
vault_name: 'ansible'
entry_name: 'default-secret'
- name: Use Secret
run: |
echo "Secret is stored in ${{ env.DVLS_ENTRY_SECRET }}"
# Your code that uses the secret
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# path: ansible/ansible_collections/devolutions/dvls
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.13
# - name: Install Python dependencies
# run: |
# python3 -m pip install --upgrade pip
# python3 -m pip install -r requirements.txt
# python3 -m pip list
# - name: Test code sanity
# run: ansible-test sanity
# - name: Build collection
# id: build
# run: |
# OUTPUT=$(ansible-galaxy collection build)
# echo "$OUTPUT"
# COLLECTION_PATH=$(echo "$OUTPUT" | grep -o '/[^ ]*\.tar\.gz')
# echo "collection_path=$COLLECTION_PATH" >> $GITHUB_OUTPUT
# echo "Collection path: $COLLECTION_PATH"
# - name: Install collection
# run: ansible-galaxy collection install ${{ steps.build.outputs.collection_path }} --force
# working-directory: ansible/ansible_collections/devolutions/dvls/tests/integration
# - name: Test collection documentation
# run: |
# # Generate the list of modules dynamically
# ansible_modules=($(ansible-doc -l devolutions.dvls | awk '{print $1}'))
# # Check if any modules were found
# if [ ${#ansible_modules[@]} -eq 0 ]; then
# echo "Error: No modules found for devolutions.dvls."
# exit 1
# fi
# echo "Modules: ${ansible_modules[@]}"
# # Loop through each module and run ansible-doc
# for ansible_module in "${ansible_modules[@]}"; do
# echo "Running ansible-doc for module: $ansible_module"
# ansible-doc -t module "$ansible_module"
# echo "----------------------------------------------------"
# done
# - name: Run get-vaults
# run: ansible-playbook test_manage_server.yml
# working-directory: ansible/ansible_collections/devolutions/dvls/tests/integration
# env:
# DVLS_APP_KEY: ${{ secrets.DVLS_APP_KEY }}
# DVLS_APP_SECRET: ${{ secrets.DVLS_APP_SECRET }}
# DVLS_SERVER_BASE_URL: ${{ secrets.DVLS_SERVER_BASE_URL }}
# DVLS_VAULT_ID: ${{ secrets.DVLS_VAULT_ID }}
# - name: Run get-secrets
# run: ansible-playbook test_manage_secrets.yml
# working-directory: ansible/ansible_collections/devolutions/dvls/tests/integration
# env:
# DVLS_APP_KEY: ${{ secrets.DVLS_APP_KEY }}
# DVLS_APP_SECRET: ${{ secrets.DVLS_APP_SECRET }}
# DVLS_SERVER_BASE_URL: ${{ secrets.DVLS_SERVER_BASE_URL }}
# DVLS_VAULT_ID: ${{ secrets.DVLS_VAULT_ID }}