chore: lint python files with Ruff #45
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| with: | |
| path: ansible/ansible_collections/devolutions/dvls | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.13 | |
| - name: Create virtual environment and install dependencies | |
| run: | | |
| echo "Creating python virtual environment" | |
| python3 -m pip install --upgrade pip | |
| python3 -m venv test | |
| echo "Activating python virtual environment" | |
| source test/bin/activate | |
| if [ -f requirements.txt ]; then | |
| echo "Installing python requirements" | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install -r requirements.txt | |
| python3 -m pip list | |
| fi | |
| - name: Test collection 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 }} |