Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 10 additions & 41 deletions .github/workflows/ansible-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
GROUP: ${{ matrix.group }} # zizmor: ignore[template-injection] -- Matrix value from controlled environment
PYTHON: python3
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env] -- Codecov token needed for coverage uploads; environment protection would block PR-triggered runs
WORKSPACE: ${{ github.workspace }}

steps:
- name: Check out code
Expand Down Expand Up @@ -129,32 +128,6 @@ jobs:
done
exit 1

- name: Get Linux workspace path
shell: pwsh
run: |
# $ws = & wslpath --% -u -a "$env:WORKSPACE""
# seems wslpath is not available on server 2019

function ConvertTo-LinuxPathCrappy {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]
$LiteralPath
)

End {
$resolved = Resolve-Path -LiteralPath $LiteralPath
$drive = ($resolved | Split-Path -Qualifier).TrimEnd(':').ToLower()
$rooted = ($resolved | Split-Path -NoQualifier).Replace('\', '/').TrimStart('/')

'/mnt/{0}/{1}' -f $drive, $rooted
}
}
$ws = ConvertTo-LinuxPathCrappy -LiteralPath "$env:WORKSPACE"
Add-Content -LiteralPath $env:GITHUB_ENV -Value "GHWS=$ws"

# Override break-sys-pkg defaults, because we don't need to bother with python venv for CI
#
# ansible-core devel requires Python >= 3.13 (see pyproject.toml on the devel branch),
Expand Down Expand Up @@ -186,14 +159,12 @@ jobs:

- name: Install collection dependencies
id: collection-dependency
# zizmor: ignore[template-injection] -- GHWS is dynamically computed earlier in the workflow
run: ansible-galaxy collection install ansible.windows -p "${{ env.GHWS }}"
run: ansible-galaxy collection install ansible.windows -p "$PWD"
continue-on-error: true

- name: Retry install collection dependencies
if: steps.collection-dependency.outcome == 'failure'
# zizmor: ignore[template-injection] -- GHWS is dynamically computed earlier in the workflow
run: ansible-galaxy collection install ansible.windows -p "${{ env.GHWS }}"
run: ansible-galaxy collection install ansible.windows -p "$PWD"

- name: Set integration test options
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/tests/integration
Expand All @@ -208,7 +179,7 @@ jobs:
with:
install: sqlengine
sa-password: L0wlydb4
version: 2022
version: 2025

- name: Retry SQL Server install
id: retry1
Expand All @@ -217,17 +188,15 @@ jobs:
with:
install: sqlengine
sa-password: L0wlydb4
version: 2022
version: 2025

- name: Run integration test # zizmor: ignore[template-injection] -- env.GHWS is a computed path; matrix values are controlled enums
run: |
pushd "${{ env.GHWS }}/ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}"
ansible-test windows-integration -v --color --retry-on-error --continue-on-error --diff --coverage --requirements windows/group/${{ matrix.group }}/
- name: Run integration test # zizmor: ignore[template-injection] -- matrix values are controlled enums
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
run: ansible-test windows-integration -v --color --retry-on-error --continue-on-error --diff --coverage --requirements windows/group/${{ matrix.group }}/

- name: Generate coverage report # zizmor: ignore[template-injection] -- env.GHWS is a computed path
run: |
pushd "${{ env.GHWS }}/ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}"
ansible-test coverage xml -v --requirements
- name: Generate coverage report
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
run: ansible-test coverage xml -v --requirements

# See the reports at https://codecov.io/gh/lowlydba/lowlydba.sqlserver
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
contents: write # Required for uploading coverage reports
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest # zizmor: ignore[unpinned-images] -- Trusted publisher for this CI use case
image: mcr.microsoft.com/mssql/server:2025-latest # zizmor: ignore[unpinned-images] -- Trusted publisher for this CI use case
ports:
- 1433:1433
env:
Expand Down