name: CI/CD Pipeline # Updated: Dynamic tag for release, CodeQL v4, Node.js 24 support on: push: branches: [ main, develop ] tags: [ 'v*' ] pull_request: branches: [ main ] env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: lint: name: Lint Ansible Playbooks runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install ansible ansible-lint yamllint - name: Lint YAML files run: | yamllint . continue-on-error: true - name: Lint Ansible playbooks run: | ansible-lint playbooks/*.yml || echo "Linting completed with warnings" continue-on-error: true - name: Validate Ansible syntax run: | for playbook in playbooks/*.yml; do ansible-playbook --syntax-check "$playbook" done test-ubuntu: name: Test on Ubuntu runs-on: ubuntu-latest needs: lint strategy: matrix: include: - ubuntu_version: '22.04' allow_failure: false - ubuntu_version: '24.04' allow_failure: false - ubuntu_version: '25.04' allow_failure: true continue-on-error: ${{ matrix.allow_failure }} steps: - name: Checkout code uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install Ansible run: | python -m pip install --upgrade pip pip install ansible - name: Create simple test inventory run: | mkdir -p test-inventory cat > test-inventory/hosts <> $GITHUB_OUTPUT echo "Using tag: ${GITHUB_REF_NAME}" - name: Generate changelog run: | echo "# Release Notes" > CHANGELOG_RELEASE.md echo "" >> CHANGELOG_RELEASE.md echo "## Changes since ${{ steps.get_tag.outputs.latest_tag }}" >> CHANGELOG_RELEASE.md echo "" >> CHANGELOG_RELEASE.md git log ${{ steps.get_tag.outputs.latest_tag }}..HEAD --pretty=format:"- %s (%h)" >> CHANGELOG_RELEASE.md || echo "- No changes since last release" >> CHANGELOG_RELEASE.md - name: Create Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.get_tag.outputs.latest_tag }} name: Release ${{ steps.get_tag.outputs.latest_tag }} body_path: CHANGELOG_RELEASE.md draft: false prerelease: false