salt-bootstrap/.github/workflows/test-linux.yml

105 lines
3.8 KiB
YAML

name: Test Linux
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
instances:
type: string
required: true
description: The Instances To Test
container-slug:
type: string
required: true
description: The Container Slug
timeout:
type: number
required: false
default: 20
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ubuntu-latest
## DGM use runner until have working systemd solution on containers
## DGM runs-on: ubuntu-latest
## DGM container:
## DGM image: ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
timeout-minutes: ${{ inputs.timeout }}
strategy:
max-parallel: 2
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v4
- name: Install Python Dependencies with pip breakage
if: ${{ ( inputs.distro-slug == 'debian-11' ) || ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
run: |
echo "DGM pip test for distro-slug ${{ inputs.distro-slug }}"
echo "DGM doing break-system-packages for distro-slug ${{ inputs.distro-slug }}"
python3 -m pip install --break-system-packages -r tests/requirements.txt
- name: Install Python Dependencies without pip breakage
if: ${{ ( inputs.distro-slug != 'debian-11' ) && ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
run: |
echo "DGM pip test for distro-slug ${{ inputs.distro-slug }}"
echo "DGM plain pip for distro-slug ${{ inputs.distro-slug }}"
python3 -m 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
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
vt_parm_ver=$(echo "$vt_parms2" | awk -F ' ' '{print $2}')
echo "vt parms ,$vt_parms, vt_parms2 ,$vt_parms2, vt_parms_ver ,$vt_parm_ver,"
echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
bt_parms2=$(echo "$bt_parms" | sed 's/-/./')
bt_arg1=$(echo "$bt_parms2" | awk -F ' ' '{print $1}')
bt_arg2=$(echo "$bt_parms2" | awk -F ' ' '{print $2}')
echo "bt parms ,$bt_parms, bt_parms2 ,$bt_parms2, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
- 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/