salt-bootstrap/.github/workflows/test-windows.yml
2024-11-07 10:02:08 -07:00

96 lines
No EOL
2.8 KiB
YAML

name: Test Windows
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
runs-on:
type: string
required: true
description: The GitHub Windows Worker To Run Workflow On
instances:
type: string
required: true
description: The Instances To Test
timeout:
type: number
required: false
default: 20
description: The timeout(in minutes) for the workflow
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: windows-latest
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Pytest
run: |
pip install -r tests\requirements.txt
- name: Get Version
run: |
# We need to get the version here and make it an environment variable
# It is used to install via bootstrap and in the test
# The version is in the instance name
$instance = "${{ matrix.instance }}"
$version = $instance -split "-",2
if ( $version.Count -gt 1 ) {
$version = $version[1].Replace("-", ".")
}
Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Get Version
run: |
# We need to get the version here and make it an environment variable
# It is used to install via bootstrap and in the test
# The version is in the instance name
$instance = "${{ matrix.instance }}"
$version = $instance -split "-",2
if ( $version.Count -gt 1 ) {
$version = $version[1].Replace("-", ".")
}
Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Bootstrap Salt
run: |
. .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion
- name: Test Bootstrap
run: |
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
path: exitstatus/