Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2314527
Test push
afeefghannam89 Mar 25, 2026
a6c719b
Stop pipeline when the PR is draft (#443)
afeefghannam89 Mar 26, 2026
f8c5da8
Use Debian 13 instead of Ubuntu (#444)
afeefghannam89 Mar 26, 2026
e85c21a
Remove elasticsearch OSS job and related molecule (#447)
afeefghannam89 Mar 27, 2026
e57ea00
Test the collection with latest Python and Ansible (#458)
afeefghannam89 Mar 31, 2026
f19723f
Molecule verification enhancement (#459)
afeefghannam89 Mar 31, 2026
6ea64c1
Fix ansible version in beats workflow (#456)
afeefghannam89 Mar 31, 2026
bcb404d
Pipelines conditions (#454)
afeefghannam89 Mar 31, 2026
8d8e815
Merge branch 'main' into feature/molecule-pipelines-refactoring
afeefghannam89 Apr 20, 2026
94a6dd8
Remove test file
afeefghannam89 Apr 21, 2026
d9e7dc4
Feature/workflows names (#461)
afeefghannam89 Apr 21, 2026
79e17a6
Add explination to the job condition
afeefghannam89 Jun 23, 2026
b406959
Merge branch 'main' into feature/molecule-pipelines-refactoring
afeefghannam89 Jun 23, 2026
f636196
Cancel outades pipeline runs (#462)
afeefghannam89 Jun 24, 2026
4ee4ad4
GitHub cache (#463)
afeefghannam89 Jun 25, 2026
e7fc97e
Merge branch 'main' into feature/molecule-pipelines-refactoring
afeefghannam89 Jun 25, 2026
adf6f1e
Fix deadlock between the workflows
afeefghannam89 Jun 25, 2026
f2c6780
Some paths are not needed in workflow
afeefghannam89 Jun 25, 2026
dfe8848
Update path in the big workflow
afeefghannam89 Jun 25, 2026
3cfe64c
Add a comment
afeefghannam89 Jun 25, 2026
c9d9c09
Merge branch 'main' into feature/molecule-pipelines-refactoring
afeefghannam89 Jun 25, 2026
35a2dbb
Remove a trigger of pipeline
afeefghannam89 Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ on:
- warning
- debug
pull_request:
push:
branches:
- 'main'
merge_group:
schedule:
- cron: '15 6 * * 4'

# Cancel outdated pipeline runs when a new push occurs in the pull request and a new pipeline starts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
kics:
security_scan:
# For non-PR events (workflow_dispatch, schedule, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true (null → 0, false → 0), so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
Comment thread
widhalmt marked this conversation as resolved.
runs-on: ubuntu-latest

steps:
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/test_full_stack.yml

This file was deleted.

32 changes: 29 additions & 3 deletions .github/workflows/test_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,32 @@ on:
rolename:
required: true
type: string
pull_request:
branches:
- '*'

# DO NOT add a concurrency block to this reusable workflow. Keep it disabled.
#
# Inside a reusable workflow (called via "uses:"), github.workflow resolves to the
# CALLER's workflow name, not "Test Linting". So the group below would evaluate to the
# exact same value as the caller's own concurrency group (e.g.
# "Test Collection Roles-refs/pull/<n>/merge"). With cancel-in-progress: true the called
# workflow would then try to cancel the in-progress run of its own parent, which GitHub
# refuses with:
# "Canceling since a deadlock was detected for concurrency group:
# 'Test Collection Roles-refs/pull/<n>/merge' between a top level workflow and 'lint_collection'"
# That deadlock cancels the lint job, which in turn skips the molecule jobs (needs: lint_*),
# and the whole run ends as failure (see PR #430).
#
# Concurrency is already handled by every calling workflow (test_roles_pr.yml,
# test_role_*.yml). Leave it to the callers and never re-enable it here.
#
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true

jobs:
lint:
# For non-PR events (workflow_dispatch, workflow_call, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true (null → 0, false → 0), so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
Expand All @@ -32,12 +52,18 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: requirements-test.txt

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.crypto community.general

- name: Lint code (yamllint).
run: |
yamllint .
Expand Down
71 changes: 60 additions & 11 deletions .github/workflows/test_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ on:
- warning
- debug
pull_request:
branches:
- 'main'
paths:
- 'plugins/**'
- 'tests/**'
- 'molecule/plugins/**'
- '.github/workflows/test_plugins.yml'

# Cancel outdated pipeline runs when a new push occurs in the pull request and a new pipeline starts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sanity_ansible_18_19:
sanity_core_2_18_2_19:
# For non-PR events (workflow_dispatch, merge_group, schedule, push, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true (null → 0, false → 0), so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand Down Expand Up @@ -64,7 +70,10 @@ jobs:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

sanity_ansible_20:
sanity_core_2_20:
# For non-PR events (workflow_dispatch, merge_group, schedule, push, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true (null → 0, false → 0), so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand Down Expand Up @@ -105,10 +114,10 @@ jobs:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

unit-test:
unit_tests:
needs:
- sanity_ansible_18_19
- sanity_ansible_20
- sanity_core_2_18_2_19
- sanity_core_2_20
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand Down Expand Up @@ -149,7 +158,7 @@ jobs:
ANSIBLE_FORCE_COLOR: '1'

molecule_plugins:
needs: unit-test
needs: unit_tests
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand All @@ -158,7 +167,7 @@ jobs:
fail-fast: false
matrix:
distro:
- ubuntu2204
- debian13
scenario:
- plugins
release:
Expand All @@ -172,13 +181,53 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: requirements-test.txt

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "ansible-core>=2.19,<2.20"
python3 -m pip install -r requirements-test.txt

- name: Get latest Elasticsearch release
id: elastic-version
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: |
curl -fsSL \
"https://artifacts.elastic.co/packages/${{ matrix.release }}.x/apt/dists/stable/main/binary-amd64/Packages.gz" \
-o /tmp/Packages.gz
VERSION=$(zcat /tmp/Packages.gz \
| awk '$1=="Package:" && $2=="elasticsearch"{p=1} p && $1=="Version:"{print $2; p=0}' \
| sort -V \
| tail -n 1)
rm -f /tmp/Packages.gz
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Debug - latest Elasticsearch version
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: echo "Latest Elasticsearch ${{ matrix.release }}.x = ${{ steps.elastic-version.outputs.version }}"

- name: Restore Elastic apt cache
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
uses: actions/cache/restore@v5
with:
path: /tmp/elastic-apt-cache
key: ${{ runner.os }}-apt-elastic-${{ steps.elastic-version.outputs.version }}
restore-keys: |
${{ runner.os }}-apt-elastic-${{ matrix.release }}.

- name: Debug - apt cache contents
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: |
echo "=== /tmp/elastic-apt-cache/ ==="
ls -lh /tmp/elastic-apt-cache/ 2>/dev/null || echo "(empty or does not exist)"
echo "=== Total size ==="
du -sh /tmp/elastic-apt-cache/ 2>/dev/null || echo "(n/a)"

- name: Ensure apt cache directory exists
run: mkdir -p /tmp/elastic-apt-cache

- name: Install collection
run: |
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
Expand All @@ -195,8 +244,8 @@ jobs:
ANSIBLE_FORCE_COLOR: '1'
ELASTIC_RELEASE: ${{ matrix.release }}

python-cryptography:
needs: unit-test
cryptography_compatibility:
needs: unit_tests
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
Expand Down
59 changes: 51 additions & 8 deletions .github/workflows/test_role_beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ on:
- warning
- debug
pull_request:
branches:
- 'feature/**'
- 'fix/**'
- '!doc/**'
paths:
- 'roles/beats/**'
- '.github/workflows/test_role_beats.yml'
- 'molecule/beats_**'

# Cancel outdated pipeline runs when a new push occurs in the pull request and a new pipeline starts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint_beats:
# For non-PR events (workflow_dispatch, merge_group, schedule, push, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true (null → 0, false → 0), so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: beats
Expand All @@ -40,15 +44,14 @@ jobs:
fail-fast: false
matrix:
distro:
- ubuntu2204
- debian13
scenario:
- beats_default
- beats_peculiar
- beats_extended
release:
- 7
- 8
ansible_version:
- "ansible>=9.0,<10.0" #Correspond ansible-core>=2.16,<2.17
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
python_version:
- "3.11"

Expand All @@ -60,13 +63,53 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
cache: 'pip'
cache-dependency-path: requirements-test.txt

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "${{ matrix.ansible_version }}"
python3 -m pip install -r requirements-test.txt

- name: Get latest Elasticsearch release
id: elastic-version
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: |
curl -fsSL \
"https://artifacts.elastic.co/packages/${{ matrix.release }}.x/apt/dists/stable/main/binary-amd64/Packages.gz" \
-o /tmp/Packages.gz
VERSION=$(zcat /tmp/Packages.gz \
| awk '$1=="Package:" && $2=="elasticsearch"{p=1} p && $1=="Version:"{print $2; p=0}' \
| sort -V \
| tail -n 1)
rm -f /tmp/Packages.gz
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Debug - latest Elasticsearch version
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: echo "Latest Elasticsearch ${{ matrix.release }}.x = ${{ steps.elastic-version.outputs.version }}"

- name: Restore Elastic apt cache
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
uses: actions/cache/restore@v5
with:
path: /tmp/elastic-apt-cache
key: ${{ runner.os }}-apt-elastic-${{ steps.elastic-version.outputs.version }}
restore-keys: |
${{ runner.os }}-apt-elastic-${{ matrix.release }}.

- name: Debug - apt cache contents
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
run: |
echo "=== /tmp/elastic-apt-cache/ ==="
ls -lh /tmp/elastic-apt-cache/ 2>/dev/null || echo "(empty or does not exist)"
echo "=== Total size ==="
du -sh /tmp/elastic-apt-cache/ 2>/dev/null || echo "(n/a)"

- name: Ensure apt cache directory exists
run: mkdir -p /tmp/elastic-apt-cache

- name: Install collection
run: |
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
Expand Down
Loading
Loading