mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Clean up un-used actions
This commit is contained in:
parent
2712a0f863
commit
163117bcf4
6 changed files with 0 additions and 2243 deletions
467
.github/workflows/test-action-linux.yml
vendored
467
.github/workflows/test-action-linux.yml
vendored
|
@ -1,467 +0,0 @@
|
|||
---
|
||||
name: Test Artifact (Linux)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
nox-session:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox session to run
|
||||
container:
|
||||
required: true
|
||||
type: string
|
||||
description: The container image to run tests on
|
||||
testrun:
|
||||
required: true
|
||||
type: string
|
||||
description: JSON string containing information about what and how to run the test suite
|
||||
gh-actions-python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.11"
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version to set prior to running tests.
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
fips:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Test run with FIPS enabled
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
workflow-slug:
|
||||
required: false
|
||||
type: string
|
||||
description: Which workflow is running.
|
||||
default: ci
|
||||
default-timeout:
|
||||
required: false
|
||||
type: number
|
||||
description: Timeout, in minutes, for the test job(Default 360, 6 hours).
|
||||
default: 360
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.10.14
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Generate Test Matrix
|
||||
id: generate-matrix
|
||||
run: |
|
||||
tools ci matrix --workflow=${{ inputs.workflow-slug }} ${{ inputs.distro-slug }}
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on:
|
||||
- ${{ inputs.arch == 'x86_64' && 'ubuntu-24.04' || 'linux-arm64' }}
|
||||
container:
|
||||
image: ${{ inputs.container }}
|
||||
# Full test runs. Each chunk should never take more than 2 hours.
|
||||
# Partial test runs(no chunk parallelization), 6 Hours
|
||||
timeout-minutes: ${{ fromJSON(inputs.testrun)['type'] == 'full' && inputs.default-timeout || 360 }}
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include) }}
|
||||
env:
|
||||
SALT_TRANSPORT: ${{ matrix.transport }}
|
||||
|
||||
steps:
|
||||
# - uses: actions/setup-python@v5
|
||||
# with:
|
||||
# python-version: '3.10'
|
||||
|
||||
- name: Check python
|
||||
run: |
|
||||
which python3
|
||||
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Salt Version
|
||||
run: |
|
||||
echo "${{ inputs.salt-version }}" > salt/_version.txt
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
echo true
|
||||
|
||||
- name: Download nox.linux.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-linux-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- linux ${{ inputs.arch }}
|
||||
|
||||
- name: Download testrun-changed-files.txt
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: testrun-changed-files.txt
|
||||
|
||||
- name: Current Directory
|
||||
run: |
|
||||
pwd
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }}
|
||||
|
||||
- name: Run Changed Tests
|
||||
id: run-fast-changed-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --core-tests --slow-tests --suppress-no-test-exit-code \
|
||||
--from-filenames=testrun-changed-files.txt
|
||||
|
||||
- name: Run Fast Tests
|
||||
id: run-fast-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code
|
||||
|
||||
- name: Run Slow Tests
|
||||
id: run-slow-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --slow-tests
|
||||
|
||||
- name: Run Core Tests
|
||||
id: run-core-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --core-tests
|
||||
|
||||
- name: Run Flaky Tests
|
||||
id: run-flaky-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --flaky-jail
|
||||
|
||||
- name: Run Full Tests
|
||||
id: run-full-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] == 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
--slow-tests --core-tests -k "mac or darwin"
|
||||
|
||||
- name: Fix file ownership
|
||||
run: |
|
||||
sudo chown -R "$(id -un)" .
|
||||
|
||||
- name: Combine Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false
|
||||
run: |
|
||||
nox --force-color -e combine-coverage
|
||||
|
||||
- name: Prepare Test Run Artifacts
|
||||
id: download-artifacts-from-vm
|
||||
if: always()
|
||||
run: |
|
||||
# Delete the salt onedir, we won't need it anymore and it will prevent
|
||||
# from it showing in the tree command below
|
||||
rm -rf artifacts/salt*
|
||||
tree -a artifacts
|
||||
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}
|
||||
fi
|
||||
|
||||
- name: Upload Code Coverage Test Run Artifacts
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-artifacts-from-vm.outcome == 'success' && job.status != 'cancelled'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/coverage/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload JUnit XML Test Run Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/xml-unittests-output/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload Test Run Log Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/logs
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Test Reports
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
- generate-matrix
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Merge JUnit XML Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Log Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Code Coverage Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Download Code Coverage Test Run Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
id: download-coverage-artifacts
|
||||
with:
|
||||
path: artifacts/coverage/
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Downloaded Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
run: |
|
||||
tree -a artifacts
|
||||
|
||||
- name: Set up Python ${{ inputs.gh-actions-python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.gh-actions-python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
|
||||
- name: Create XML Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
|
||||
run: |
|
||||
nox --force-color -e create-xml-coverage-reports
|
||||
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
|
||||
- name: Report Salt Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage -- salt
|
||||
|
||||
- name: Report Combined Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage
|
||||
|
||||
- name: Rename Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
|
||||
- name: Upload Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: all-testrun-coverage-artifacts-${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
path: artifacts/coverage
|
||||
include-hidden-files: true
|
452
.github/workflows/test-action-macos.yml
vendored
452
.github/workflows/test-action-macos.yml
vendored
|
@ -1,452 +0,0 @@
|
|||
---
|
||||
name: Test Artifact(macOS)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
description: The GitHub runner name
|
||||
nox-session:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox session to run
|
||||
testrun:
|
||||
required: true
|
||||
type: string
|
||||
description: JSON string containing information about what and how to run the test suite
|
||||
gh-actions-python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.11"
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version to set prior to running tests.
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
workflow-slug:
|
||||
required: false
|
||||
type: string
|
||||
description: Which workflow is running.
|
||||
default: ci
|
||||
default-timeout:
|
||||
required: false
|
||||
type: number
|
||||
description: Timeout, in minutes, for the test job(Default 360, 6 hours).
|
||||
default: 360
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Generate Test Matrix
|
||||
id: generate-matrix
|
||||
run: |
|
||||
tools ci matrix --workflow=${{ inputs.workflow-slug }} ${{ inputs.distro-slug }}
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ inputs.runner }}
|
||||
# Full test runs. Each chunk should never take more than 2 hours.
|
||||
# Partial test runs(no chunk parallelization), 6 Hours
|
||||
timeout-minutes: ${{ fromJSON(inputs.testrun)['type'] == 'full' && inputs.default-timeout || 360 }}
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include) }}
|
||||
env:
|
||||
SALT_TRANSPORT: ${{ matrix.transport }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Salt Version
|
||||
run: |
|
||||
echo "${{ inputs.salt-version }}" > salt/_version.txt
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
brew install tree
|
||||
|
||||
- name: Download nox.macos.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-macos-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Set up Python ${{ inputs.gh-actions-python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.gh-actions-python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- macos ${{ inputs.arch }}
|
||||
|
||||
- name: Download testrun-changed-files.txt
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: testrun-changed-files.txt
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }}
|
||||
|
||||
- name: Run Changed Tests
|
||||
id: run-fast-changed-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --core-tests --slow-tests --suppress-no-test-exit-code \
|
||||
--from-filenames=testrun-changed-files.txt
|
||||
|
||||
- name: Run Fast Tests
|
||||
id: run-fast-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code
|
||||
|
||||
- name: Run Slow Tests
|
||||
id: run-slow-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --slow-tests
|
||||
|
||||
- name: Run Core Tests
|
||||
id: run-core-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --core-tests
|
||||
|
||||
- name: Run Flaky Tests
|
||||
id: run-flaky-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
-k "mac or darwin" --suppress-no-test-exit-code --no-fast-tests --flaky-jail
|
||||
|
||||
- name: Run Full Tests
|
||||
id: run-full-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] == 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} -- \
|
||||
--slow-tests --core-tests -k "mac or darwin"
|
||||
|
||||
- name: Fix file ownership
|
||||
run: |
|
||||
sudo chown -R "$(id -un)" .
|
||||
|
||||
- name: Combine Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false
|
||||
run: |
|
||||
nox --force-color -e combine-coverage
|
||||
|
||||
- name: Prepare Test Run Artifacts
|
||||
id: download-artifacts-from-vm
|
||||
if: always()
|
||||
run: |
|
||||
# Delete the salt onedir, we won't need it anymore and it will prevent
|
||||
# from it showing in the tree command below
|
||||
rm -rf artifacts/salt*
|
||||
tree -a artifacts
|
||||
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}
|
||||
fi
|
||||
|
||||
- name: Upload Code Coverage Test Run Artifacts
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-artifacts-from-vm.outcome == 'success' && job.status != 'cancelled'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/coverage/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload JUnit XML Test Run Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/xml-unittests-output/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload Test Run Log Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/logs
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Test Reports
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
- generate-matrix
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Merge JUnit XML Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Log Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Code Coverage Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Download Code Coverage Test Run Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
id: download-coverage-artifacts
|
||||
with:
|
||||
path: artifacts/coverage/
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Downloaded Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
run: |
|
||||
tree -a artifacts
|
||||
|
||||
- name: Set up Python ${{ inputs.gh-actions-python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.gh-actions-python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
|
||||
- name: Create XML Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
|
||||
run: |
|
||||
nox --force-color -e create-xml-coverage-reports
|
||||
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
|
||||
- name: Report Salt Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage -- salt
|
||||
|
||||
- name: Report Combined Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage
|
||||
|
||||
- name: Rename Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
|
||||
- name: Upload Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: all-testrun-coverage-artifacts-${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
path: artifacts/coverage
|
||||
include-hidden-files: true
|
457
.github/workflows/test-action-windows.yml
vendored
457
.github/workflows/test-action-windows.yml
vendored
|
@ -1,457 +0,0 @@
|
|||
---
|
||||
name: Test Artifact(Windows)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
nox-session:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox session to run
|
||||
testrun:
|
||||
required: true
|
||||
type: string
|
||||
description: JSON string containing information about what and how to run the test suite
|
||||
gh-actions-python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.11"
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version to set prior to running tests.
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
fips:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Test run with FIPS enabled
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
workflow-slug:
|
||||
required: false
|
||||
type: string
|
||||
description: Which workflow is running.
|
||||
default: ci
|
||||
default-timeout:
|
||||
required: false
|
||||
type: number
|
||||
description: Timeout, in minutes, for the test job(Default 360, 6 hours).
|
||||
default: 360
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.10.14
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Generate Test Matrix
|
||||
id: generate-matrix
|
||||
run: |
|
||||
tools ci matrix --workflow=${{ inputs.workflow-slug }} ${{ fromJSON(inputs.testrun)['type'] == 'full' && '--full ' || '' }}${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }}
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ inputs.distro-slug }}
|
||||
# Full test runs. Each chunk should never take more than 2 hours.
|
||||
# Partial test runs(no chunk parallelization), 6 Hours
|
||||
timeout-minutes: ${{ fromJSON(inputs.testrun)['type'] == 'full' && inputs.default-timeout || 360 }}
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include) }}
|
||||
env:
|
||||
SALT_TRANSPORT: ${{ matrix.transport }}
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Salt Version
|
||||
run: |
|
||||
echo "${{ inputs.salt-version }}" > salt/_version.txt
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
echo true
|
||||
|
||||
- name: Set up Python ${{ inputs.gh-actions-python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.gh-actions-python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Download nox.windows.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-windows-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- windows ${{ inputs.arch }}
|
||||
|
||||
- name: Download testrun-changed-files.txt
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: testrun-changed-files.txt
|
||||
|
||||
- name: Check nox python
|
||||
continue-on-error: true
|
||||
run: |
|
||||
.nox/ci-test-onedir/Scripts/python.exe --version
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }}
|
||||
|
||||
- name: Run Changed Tests
|
||||
id: run-fast-changed-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
-k "win" --core-tests --slow-tests --suppress-no-test-exit-code
|
||||
"--from-filenames=testrun-changed-files.txt"
|
||||
|
||||
- name: Run Fast Tests
|
||||
id: run-fast-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
-k "win" --suppress-no-test-exit-code
|
||||
|
||||
- name: Run Slow Tests
|
||||
id: run-slow-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
-k "win" --suppress-no-test-exit-code --no-fast-tests --slow-tests
|
||||
|
||||
- name: Run Core Tests
|
||||
id: run-core-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
-k "win" --suppress-no-test-exit-code --no-fast-tests --core-tests
|
||||
|
||||
- name: Run Flaky Tests
|
||||
id: run-flaky-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
-k "win" --suppress-no-test-exit-code --no-fast-tests --flaky-jail
|
||||
|
||||
- name: Run Full Tests
|
||||
id: run-full-tests
|
||||
if: ${{ fromJSON(inputs.testrun)['type'] == 'full' }}
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: >
|
||||
nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.tests-chunk }} --
|
||||
--slow-tests --core-tests -k "win"
|
||||
|
||||
- name: Combine Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false
|
||||
run: |
|
||||
nox --force-color -e combine-coverage
|
||||
|
||||
- name: Prepare Test Run Artifacts
|
||||
id: download-artifacts-from-vm
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Delete the salt onedir, we won't need it anymore and it will prevent
|
||||
# from it showing in the tree command below
|
||||
rm -rf artifacts/salt*
|
||||
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}
|
||||
fi
|
||||
|
||||
- name: Upload Code Coverage Test Run Artifacts
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-artifacts-from-vm.outcome == 'success' && job.status != 'cancelled'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/coverage/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload JUnit XML Test Run Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/xml-unittests-output/
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload Test Run Log Artifacts
|
||||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/logs
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Test Reports
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
- generate-matrix
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Merge JUnit XML Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Log Test Run Artifacts
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Merge Code Coverage Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*
|
||||
separate-directories: false
|
||||
delete-merged: true
|
||||
|
||||
- name: Download Code Coverage Test Run Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
id: download-coverage-artifacts
|
||||
with:
|
||||
path: artifacts/coverage/
|
||||
pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Downloaded Test Run Artifacts
|
||||
if: ${{ inputs.skip-code-coverage == false }}
|
||||
run: |
|
||||
tree -a artifacts
|
||||
|
||||
- name: Set up Python ${{ inputs.gh-actions-python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.gh-actions-python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
|
||||
- name: Create XML Coverage Reports
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
|
||||
run: |
|
||||
nox --force-color -e create-xml-coverage-reports
|
||||
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
|
||||
|
||||
- name: Report Salt Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage -- salt
|
||||
|
||||
- name: Report Combined Code Coverage
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
nox --force-color -e report-coverage
|
||||
|
||||
- name: Rename Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
|
||||
- name: Upload Code Coverage DB
|
||||
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: all-testrun-coverage-artifacts-${{ inputs.distro-slug }}.${{ inputs.nox-session }}
|
||||
path: artifacts/coverage
|
||||
include-hidden-files: true
|
288
.github/workflows/test-packages-action-linux.yml
vendored
288
.github/workflows/test-packages-action-linux.yml
vendored
|
@ -1,288 +0,0 @@
|
|||
name: Test Artifact
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
container:
|
||||
required: true
|
||||
type: string
|
||||
description: The container image to run tests on
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
pkg-type:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version of the packages to install and test
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
testing-releases:
|
||||
required: true
|
||||
type: string
|
||||
description: A JSON list of releases to test upgrades against
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.10"
|
||||
fips:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Test run with FIPS enabled
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
nox-session:
|
||||
required: false
|
||||
type: string
|
||||
description: The nox session to run
|
||||
default: ci-test-onedir
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
AWS_MAX_ATTEMPTS: "10"
|
||||
AWS_RETRY_MODE: "adaptive"
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
USE_S3_CACHE: 'false'
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Generate Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
pkg-matrix-include: ${{ steps.generate-pkg-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-pkg-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
|
||||
- name: Generate Package Test Matrix
|
||||
id: generate-pkg-matrix
|
||||
run: |
|
||||
tools ci pkg-matrix ${{ inputs.distro-slug }} \
|
||||
${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }}
|
||||
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on:
|
||||
- ${{ inputs.arch == 'x86_64' && 'ubuntu-24.04' || 'linux-arm64' }}
|
||||
container:
|
||||
image: ${{ inputs.container }}
|
||||
options: --privileged
|
||||
timeout-minutes: 120 # 2 Hours - More than this and something is wrong
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Packages
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-${{ inputs.arch }}-${{ inputs.pkg-type }}
|
||||
path: artifacts/pkg/
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
#- name: Set up Python ${{ inputs.python-version }}
|
||||
# uses: actions/setup-python@v5
|
||||
# with:
|
||||
# python-version: "${{ inputs.python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: List Packages
|
||||
run: |
|
||||
tree artifacts/pkg/
|
||||
|
||||
- name: Download nox.linux.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-linux-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- linux ${{ inputs.arch }}
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
|
||||
- name: List Free Space
|
||||
run: |
|
||||
tools --timestamps vm ssh ${{ inputs.distro-slug }} -- df -h || true
|
||||
|
||||
# - name: check systemd
|
||||
# run: systemctl
|
||||
#
|
||||
#- name: Mock systemd
|
||||
# run: |
|
||||
# wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/refs/heads/master/files/docker/systemctl3.py
|
||||
# cp systemctl3.py /usr/bin/systemctl
|
||||
# chmod +x /usr/bin/systemctl
|
||||
#
|
||||
#- name: install pkg test
|
||||
# run: |
|
||||
# dpkg -i ./artifacts/pkg/salt-common_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb ./artifacts/pkg/salt-master_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }}
|
||||
|
||||
- name: Run Package Tests
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \
|
||||
${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}}
|
||||
|
||||
- name: Upload Test Run Log Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pkg-testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/logs
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload Test Run Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/
|
||||
!artifacts/pkg/*
|
||||
!artifacts/salt/*
|
||||
!artifacts/salt-*.tar.*
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Report
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
needs:
|
||||
- generate-matrix
|
||||
- test
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Wait For Artifacts
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Merge Test Run Artifacts
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }}
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }}-*
|
||||
separate-directories: true
|
||||
delete-merged: true
|
||||
|
||||
- name: Wait For Artifacts 2
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Download Test Run Artifacts
|
||||
id: download-test-run-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts/
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Test Run Artifacts
|
||||
if: always()
|
||||
run: |
|
||||
tree -a artifacts
|
282
.github/workflows/test-packages-action-macos.yml
vendored
282
.github/workflows/test-packages-action-macos.yml
vendored
|
@ -1,282 +0,0 @@
|
|||
name: Test Artifact
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
description: The GitHub runner name
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
pkg-type:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version of the packages to install and test
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
testing-releases:
|
||||
required: true
|
||||
type: string
|
||||
description: A JSON list of releases to test upgrades against
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.10"
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
nox-session:
|
||||
required: false
|
||||
type: string
|
||||
description: The nox session to run
|
||||
default: ci-test-onedir
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Generate Matrix
|
||||
runs-on:
|
||||
# We need to run on our self-hosted runners because we need proper credentials
|
||||
# for boto3 to scan through our repositories.
|
||||
- ubuntu-latest
|
||||
outputs:
|
||||
pkg-matrix-include: ${{ steps.generate-pkg-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-pkg-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
|
||||
- name: Generate Package Test Matrix
|
||||
id: generate-pkg-matrix
|
||||
run: |
|
||||
tools ci pkg-matrix ${{ inputs.distro-slug }} ${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }}
|
||||
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ inputs.runner }}
|
||||
timeout-minutes: 150 # 2 & 1/2 Hours - More than this and something is wrong (MacOS needs a little more time)
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Packages
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: salt-${{ inputs.salt-version }}-${{ inputs.arch }}-${{ inputs.pkg-type }}
|
||||
path: artifacts/pkg/
|
||||
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
brew install tree
|
||||
|
||||
- name: List Packages
|
||||
run: |
|
||||
tree artifacts/pkg/
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- name: Download nox.macos.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-macos-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- macos ${{ inputs.arch }}
|
||||
|
||||
- name: Disable Gatekeeper
|
||||
run: |
|
||||
sudo -E spctl --master-disable
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }}
|
||||
|
||||
- name: Run Package Tests
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
run: |
|
||||
sudo -E nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \
|
||||
${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}}
|
||||
|
||||
- name: Fix file ownership
|
||||
run: |
|
||||
sudo chown -R "$(id -un)" .
|
||||
|
||||
- name: Prepare Test Run Artifacts
|
||||
id: download-artifacts-from-vm
|
||||
if: always()
|
||||
run: |
|
||||
# Delete the salt onedir, we won't need it anymore and it will prevent
|
||||
# from it showing in the tree command below
|
||||
rm -rf artifacts/salt*
|
||||
tree -a artifacts
|
||||
|
||||
- name: Upload Test Run Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/
|
||||
!artifacts/pkg/*
|
||||
!artifacts/salt/*
|
||||
!artifacts/salt-*.tar.*
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Report
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
needs:
|
||||
- generate-matrix
|
||||
- test
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Wait For Artifacts
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Merge Test Run Artifacts
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-*
|
||||
separate-directories: true
|
||||
delete-merged: true
|
||||
|
||||
- name: Wait For Artifacts 2
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Download Test Run Artifacts
|
||||
id: download-test-run-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts/
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Test Run Artifacts
|
||||
if: always() && steps.download-test-run-artifacts.outcome == 'success'
|
||||
run: |
|
||||
tree -a artifacts
|
||||
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.python-version }}"
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
297
.github/workflows/test-packages-action-windows.yml
vendored
297
.github/workflows/test-packages-action-windows.yml
vendored
|
@ -1,297 +0,0 @@
|
|||
name: Test Artifact
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
distro-slug:
|
||||
required: true
|
||||
type: string
|
||||
description: The OS slug to run tests against
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
pkg-type:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version of the packages to install and test
|
||||
cache-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: Seed used to invalidate caches
|
||||
testing-releases:
|
||||
required: true
|
||||
type: string
|
||||
description: A JSON list of releases to test upgrades against
|
||||
nox-version:
|
||||
required: true
|
||||
type: string
|
||||
description: The nox version to install
|
||||
python-version:
|
||||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.10"
|
||||
fips:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Test run with FIPS enabled
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
description: The onedir package name to use
|
||||
default: salt
|
||||
nox-session:
|
||||
required: false
|
||||
type: string
|
||||
description: The nox session to run
|
||||
default: ci-test-onedir
|
||||
skip-code-coverage:
|
||||
required: false
|
||||
type: boolean
|
||||
description: Skip code coverage
|
||||
default: false
|
||||
|
||||
env:
|
||||
COLUMNS: 190
|
||||
AWS_MAX_ATTEMPTS: "10"
|
||||
AWS_RETRY_MODE: "adaptive"
|
||||
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
|
||||
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
|
||||
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Generate Matrix
|
||||
runs-on:
|
||||
# We need to run on our self-hosted runners because we need proper credentials
|
||||
# for boto3 to scan through our repositories.
|
||||
- ubuntu-latest
|
||||
outputs:
|
||||
pkg-matrix-include: ${{ steps.generate-pkg-matrix.outputs.matrix }}
|
||||
build-reports: ${{ steps.generate-pkg-matrix.outputs.build-reports }}
|
||||
steps:
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
|
||||
- name: Generate Package Test Matrix
|
||||
id: generate-pkg-matrix
|
||||
run: |
|
||||
tools ci pkg-matrix ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \
|
||||
${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }}
|
||||
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ${{ inputs.distro-slug }}
|
||||
timeout-minutes: 120 # 2 Hours - More than this and something is wrong
|
||||
needs:
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ inputs.python-version }}"
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(1, 15)))'); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
|
||||
- name: "Set `TIMESTAMP` environment variable"
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Packages
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-${{ inputs.arch }}-${{ inputs.pkg-type }}
|
||||
path: ./artifacts/pkg/
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: ./artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Install Nox
|
||||
run: |
|
||||
python3 -m pip install 'nox==${{ inputs.nox-version }}'
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
- run: python3 --version
|
||||
|
||||
- name: Download nox.windows.${{ inputs.arch }}.tar.* artifact for session ${{ inputs.nox-session }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nox-windows-${{ inputs.arch }}-${{ inputs.nox-session }}
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
nox --force-color -e decompress-dependencies -- windows ${{ inputs.arch }}
|
||||
|
||||
- name: List Important Directories
|
||||
run: |
|
||||
dir d:/
|
||||
dir .
|
||||
dir artifacts/
|
||||
dir artifacts/pkg
|
||||
dir .nox/ci-test-onedir/Scripts
|
||||
|
||||
- name: Check onedir python
|
||||
continue-on-error: true
|
||||
run: |
|
||||
artifacts/salt/Scripts/python.exe --version
|
||||
|
||||
- name: Check nox python
|
||||
continue-on-error: true
|
||||
run: |
|
||||
.nox/ci-test-onedir/Scripts/python.exe --version
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
SKIP_CODE_COVERAGE: "1"
|
||||
PRINT_SYSTEM_INFO_ONLY: "1"
|
||||
PYTHONUTF8: "1"
|
||||
run: |
|
||||
nox --force-color -f noxfile.py -e "${{ inputs.nox-session }}-pkgs" -- '${{ matrix.tests-chunk }}' --log-cli-level=debug
|
||||
|
||||
- name: Run Package Tests
|
||||
env:
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "0"
|
||||
PRINT_TEST_PLAN_ONLY: "0"
|
||||
PRINT_SYSTEM_INFO: "0"
|
||||
RERUN_FAILURES: "1"
|
||||
GITHUB_ACTIONS_PIPELINE: "1"
|
||||
SKIP_INITIAL_ONEDIR_FAILURES: "1"
|
||||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
COVERAGE_CONTEXT: ${{ inputs.distro-slug }}
|
||||
OUTPUT_COLUMNS: "190"
|
||||
PYTHONUTF8: "1"
|
||||
run: >
|
||||
nox --force-color -f noxfile.py -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }}
|
||||
${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}}
|
||||
|
||||
- name: Prepare Test Run Artifacts
|
||||
id: download-artifacts-from-vm
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Delete the salt onedir, we won't need it anymore and it will prevent
|
||||
# from it showing in the tree command below
|
||||
rm -rf artifacts/salt*
|
||||
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}
|
||||
fi
|
||||
|
||||
- name: Upload Test Run Log Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pkg-testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/logs
|
||||
include-hidden-files: true
|
||||
|
||||
- name: Upload Test Run Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}}-${{ env.TIMESTAMP }}
|
||||
path: |
|
||||
artifacts/
|
||||
!artifacts/pkg/*
|
||||
!artifacts/salt/*
|
||||
!artifacts/salt-*.tar.*
|
||||
include-hidden-files: true
|
||||
|
||||
report:
|
||||
name: Report
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
needs:
|
||||
- generate-matrix
|
||||
- test
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Throttle Builds"
|
||||
shell: bash
|
||||
run: |
|
||||
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
|
||||
|
||||
- name: Wait For Artifacts
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Merge Test Run Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-*
|
||||
separate-directories: true
|
||||
delete-merged: true
|
||||
|
||||
- name: Wait For Artifacts 2
|
||||
run: |
|
||||
sleep 60
|
||||
|
||||
- name: Download Test Run Artifacts
|
||||
id: download-test-run-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts/
|
||||
pattern: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Show Test Run Artifacts
|
||||
if: always() && steps.download-test-run-artifacts.outcome == 'success'
|
||||
run: |
|
||||
tree -a artifacts
|
Loading…
Add table
Reference in a new issue