Skip to content

Merge pull request #3 from dmurphy18/test_bld #16

Merge pull request #3 from dmurphy18/test_bld

Merge pull request #3 from dmurphy18/test_bld #16

Workflow file for this run

---
name: Testing
on: [push, pull_request]
jobs:
Pre-Commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Install System Deps
run: |
sudo apt-get update
sudo apt-get install -y libxml2 libxml2-dev libxslt-dev
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.0
Docs:
runs-on: ubuntu-latest
needs: Pre-Commit
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10 For Nox
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Doc Requirements
run: |
nox --force-color -e docs --install-only
- name: Build Docs
env:
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e docs
- name: Upload built docs as artifact
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/_build/html
Linux:
runs-on: ubuntu-latest
needs: Pre-Commit
timeout-minutes: 15
strategy:
fail-fast: false
max-parallel: 4
matrix:
include:
- {salt-version: "3006.8", python-version: "3.10"}
- {salt-version: "3007.1", python-version: "3.10"}
## - {salt-version: "3007", python-version: "3.12"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # coverage: Issue detecting commit SHA
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Test Requirements
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
run: |
nox --force-color -e tests-3 --install-only
- name: Test
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e tests-3 -- -vv tests/
- name: Create CodeCov Flags
if: always()
id: codecov-flags
run: |
echo flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))") >> $GITHUB_OUTPUT
- name: Upload Project Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
REPORT_PATH: artifacts/coverage-project.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Tests Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
REPORT_PATH: artifacts/coverage-tests.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log
Windows:
runs-on: windows-latest
needs: Pre-Commit
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 3
matrix:
include:
- {salt-version: "3006.8", python-version: "3.10"}
- {salt-version: "3007.1", python-version: "3.10"}
## - {salt-version: "3007", python-version: "3.12"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Test Requirements
shell: bash
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
EXTRA_REQUIREMENTS_INSTALL: Cython
run: |
export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH"
nox --force-color -e tests-3 --install-only
- name: Test
shell: bash
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
SKIP_REQUIREMENTS_INSTALL: true
run: |
export PATH="/C/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64;$PATH"
nox --force-color -e tests-3 -- -vv tests/
- name: Create CodeCov Flags
if: always()
id: codecov-flags
run: |
echo flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))") >> $GITHUB_OUTPUT
- name: Upload Project Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
REPORT_PATH: artifacts/coverage-project.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Tests Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
REPORT_PATH: artifacts/coverage-tests.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log
macOS:
runs-on: macOS-latest
needs: Pre-Commit
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 3
matrix:
include:
- {salt-version: "3006.8", python-version: "3.10"}
- {salt-version: "3007.1", python-version: "3.10"}
## - {salt-version: "3007", python-version: "3.12"}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Test Requirements
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
run: |
nox --force-color -e tests-3 --install-only
- name: Test
env:
SALT_REQUIREMENT: salt==${{ matrix.salt-version }}
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e tests-3 -- -vv tests/
- name: Create CodeCov Flags
if: always()
id: codecov-flags
run: |
echo flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))") >> $GITHUB_OUTPUT
- name: Upload Project Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
REPORT_PATH: artifacts/coverage-project.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Tests Code Coverage
if: always()
continue-on-error: true
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
REPORT_PATH: artifacts/coverage-tests.xml
run: |
if [ ! -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
break
fi
n=$((n+1))
sleep 15
done
fi
if [ -f codecov.sh ]; then
n=0
until [ "$n" -ge 5 ]
do
if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
break
fi
n=$((n+1))
sleep 15
done
fi
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log
path: artifacts/runtests-*.log