mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Also drop matrix usage for macOS and Windows
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
1b765b1d54
commit
eb20a93fcc
6 changed files with 118 additions and 161 deletions
35
.github/workflows/release.yml
vendored
35
.github/workflows/release.yml
vendored
|
@ -479,8 +479,8 @@ jobs:
|
|||
artifacts-from-workflow: staging.yml
|
||||
secrets: inherit
|
||||
|
||||
test-macos-pkg-downloads:
|
||||
name: Test macOS Package Downloads
|
||||
macos-12-pkg-download-tests:
|
||||
name: Test macOS 12 Package Downloads
|
||||
if: ${{ inputs.skip-salt-pkg-download-test-suite == false }}
|
||||
needs:
|
||||
- prepare-workflow
|
||||
|
@ -489,6 +489,7 @@ jobs:
|
|||
with:
|
||||
distro-slug: macos-12
|
||||
platform: darwin
|
||||
arch: x86_64
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: release
|
||||
|
@ -496,9 +497,9 @@ jobs:
|
|||
artifacts-from-workflow: staging.yml
|
||||
secrets: inherit
|
||||
|
||||
test-windows-pkg-downloads:
|
||||
windows-2022-nsis-pkg-download-tests:
|
||||
if: ${{ inputs.skip-salt-pkg-download-test-suite == false }}
|
||||
name: Test Windows Package Downloads
|
||||
name: Test Windows 2022 NSIS Package Downloads
|
||||
needs:
|
||||
- prepare-workflow
|
||||
- publish-repositories
|
||||
|
@ -506,6 +507,27 @@ jobs:
|
|||
with:
|
||||
distro-slug: windows-2022
|
||||
platform: windows
|
||||
arch: amd64
|
||||
pkg-type: NSIS
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: release
|
||||
skip-code-coverage: true
|
||||
artifacts-from-workflow: staging.yml
|
||||
secrets: inherit
|
||||
|
||||
windows-2022-msi-pkg-download-tests:
|
||||
if: ${{ inputs.skip-salt-pkg-download-test-suite == false }}
|
||||
name: Test Windows 2022 MSI Package Downloads
|
||||
needs:
|
||||
- prepare-workflow
|
||||
- publish-repositories
|
||||
uses: ./.github/workflows/test-package-downloads-action-windows.yml
|
||||
with:
|
||||
distro-slug: windows-2022
|
||||
platform: windows
|
||||
arch: amd64
|
||||
pkg-type: MSI
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: release
|
||||
|
@ -541,8 +563,9 @@ jobs:
|
|||
- ubuntu-2004-arm64-pkg-download-tests
|
||||
- ubuntu-2204-pkg-download-tests
|
||||
- ubuntu-2204-arm64-pkg-download-tests
|
||||
- test-macos-pkg-downloads
|
||||
- test-windows-pkg-downloads
|
||||
- macos-12-pkg-download-tests
|
||||
- windows-2022-nsis-pkg-download-tests
|
||||
- windows-2022-msi-pkg-download-tests
|
||||
environment: release
|
||||
steps:
|
||||
- name: Clone The Salt Repository
|
||||
|
|
34
.github/workflows/staging.yml
vendored
34
.github/workflows/staging.yml
vendored
|
@ -2390,8 +2390,8 @@ jobs:
|
|||
skip-code-coverage: true
|
||||
secrets: inherit
|
||||
|
||||
test-macos-pkg-downloads:
|
||||
name: Test macOS Package Downloads
|
||||
macos-12-pkg-download-tests:
|
||||
name: Test macOS 12 Package Downloads
|
||||
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg-download'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
|
||||
needs:
|
||||
- prepare-workflow
|
||||
|
@ -2400,15 +2400,16 @@ jobs:
|
|||
with:
|
||||
distro-slug: macos-12
|
||||
platform: darwin
|
||||
arch: x86_64
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: staging
|
||||
skip-code-coverage: true
|
||||
secrets: inherit
|
||||
|
||||
test-windows-pkg-downloads:
|
||||
windows-2022-nsis-pkg-download-tests:
|
||||
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg-download'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
|
||||
name: Test Windows Package Downloads
|
||||
name: Test Windows 2022 NSIS Package Downloads
|
||||
needs:
|
||||
- prepare-workflow
|
||||
- publish-repositories
|
||||
|
@ -2416,6 +2417,26 @@ jobs:
|
|||
with:
|
||||
distro-slug: windows-2022
|
||||
platform: windows
|
||||
arch: amd64
|
||||
pkg-type: NSIS
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: staging
|
||||
skip-code-coverage: true
|
||||
secrets: inherit
|
||||
|
||||
windows-2022-msi-pkg-download-tests:
|
||||
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg-download'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
|
||||
name: Test Windows 2022 MSI Package Downloads
|
||||
needs:
|
||||
- prepare-workflow
|
||||
- publish-repositories
|
||||
uses: ./.github/workflows/test-package-downloads-action-windows.yml
|
||||
with:
|
||||
distro-slug: windows-2022
|
||||
platform: windows
|
||||
arch: amd64
|
||||
pkg-type: MSI
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: staging
|
||||
|
@ -2490,8 +2511,9 @@ jobs:
|
|||
- ubuntu-2004-arm64-pkg-download-tests
|
||||
- ubuntu-2204-pkg-download-tests
|
||||
- ubuntu-2204-arm64-pkg-download-tests
|
||||
- test-macos-pkg-downloads
|
||||
- test-windows-pkg-downloads
|
||||
- macos-12-pkg-download-tests
|
||||
- windows-2022-nsis-pkg-download-tests
|
||||
- windows-2022-msi-pkg-download-tests
|
||||
environment: staging
|
||||
runs-on:
|
||||
- self-hosted
|
||||
|
|
|
@ -52,11 +52,12 @@
|
|||
<%- endfor %>
|
||||
|
||||
|
||||
<%- set job_name = "test-macos-pkg-downloads" %>
|
||||
<%- for slug, display_name, arch in (("macos-12", "macOS 12", "x86_64"),) %>
|
||||
<%- set job_name = "{}-pkg-download-tests".format(slug.replace(".", "")) %>
|
||||
|
||||
<{ job_name }>:
|
||||
<%- do test_repo_needs.append(job_name) %>
|
||||
name: Test macOS Package Downloads
|
||||
name: Test <{ display_name }> Package Downloads
|
||||
<%- if gh_environment == "staging" %>
|
||||
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg-download'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }}
|
||||
<%- else %>
|
||||
|
@ -67,8 +68,9 @@
|
|||
- publish-repositories
|
||||
uses: ./.github/workflows/test-package-downloads-action-macos.yml
|
||||
with:
|
||||
distro-slug: macos-12
|
||||
distro-slug: <{ slug }>
|
||||
platform: darwin
|
||||
arch: <{ arch }>
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version_macos }>
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: <{ gh_environment }>
|
||||
|
@ -77,9 +79,14 @@
|
|||
artifacts-from-workflow: staging.yml
|
||||
<%- endif %>
|
||||
secrets: inherit
|
||||
<%- endfor %>
|
||||
|
||||
|
||||
<%- set job_name = "test-windows-pkg-downloads" %>
|
||||
<%- for slug, display_name, arch in (
|
||||
("windows-2022", "Windows 2022", "amd64"),
|
||||
) %>
|
||||
<%- for pkg_type in ("NSIS", "MSI") %>
|
||||
<%- set job_name = "{}-{}-pkg-download-tests".format(slug.replace(".", ""), pkg_type.lower()) %>
|
||||
|
||||
<{ job_name }>:
|
||||
<%- do test_repo_needs.append(job_name) %>
|
||||
|
@ -88,14 +95,16 @@
|
|||
<%- else %>
|
||||
if: ${{ inputs.skip-salt-pkg-download-test-suite == false }}
|
||||
<%- endif %>
|
||||
name: Test Windows Package Downloads
|
||||
name: Test <{ display_name }> <{ pkg_type }> Package Downloads
|
||||
needs:
|
||||
- prepare-workflow
|
||||
- publish-repositories
|
||||
uses: ./.github/workflows/test-package-downloads-action-windows.yml
|
||||
with:
|
||||
distro-slug: windows-2022
|
||||
distro-slug: <{ slug }>
|
||||
platform: windows
|
||||
arch: <{ arch }>
|
||||
pkg-type: <{ pkg_type }>
|
||||
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version_windows }>
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
environment: <{ gh_environment }>
|
||||
|
@ -104,3 +113,5 @@
|
|||
artifacts-from-workflow: staging.yml
|
||||
<%- endif %>
|
||||
secrets: inherit
|
||||
<%- endfor %>
|
||||
<%- endfor %>
|
||||
|
|
|
@ -11,6 +11,10 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
description: The platform being tested
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
description: The platform arch being tested
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
|
@ -62,34 +66,10 @@ env:
|
|||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Generate Package Test Matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
arch-matrix-include: ${{ steps.generate-pkg-matrix.outputs.arch }}
|
||||
test-matrix-include: ${{ steps.generate-pkg-matrix.outputs.tests }}
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
|
||||
- name: Generate Package Test Matrix
|
||||
id: generate-pkg-matrix
|
||||
run: |
|
||||
tools ci pkg-download-matrix macos
|
||||
|
||||
dependencies:
|
||||
name: Setup Test Dependencies
|
||||
needs:
|
||||
- generate-matrix
|
||||
runs-on: ${{ inputs.distro-slug }}
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.arch-matrix-include) }}
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -99,13 +79,13 @@ jobs:
|
|||
uses: actions/cache@v3
|
||||
with:
|
||||
path: nox.${{ inputs.distro-slug }}.tar.*
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ matrix.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
if: inputs.artifacts-from-workflow == ''
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact(from a different workflow)
|
||||
|
@ -116,7 +96,7 @@ jobs:
|
|||
workflow_conclusion: ""
|
||||
branch: ${{ github.event.ref }}
|
||||
if_no_artifact_found: fail
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
|
@ -125,7 +105,7 @@ jobs:
|
|||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
|
||||
|
@ -169,8 +149,8 @@ jobs:
|
|||
- name: Upload Onedir Tarball as an Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
path: artifacts/${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz*
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz*
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
|
@ -187,11 +167,6 @@ jobs:
|
|||
timeout-minutes: 120 # 2 Hours - More than this and something is wrong
|
||||
needs:
|
||||
- dependencies
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.test-matrix-include) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
|
@ -200,7 +175,7 @@ jobs:
|
|||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts
|
||||
|
||||
- name: Install System Dependencies
|
||||
|
@ -212,7 +187,7 @@ jobs:
|
|||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
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@v4
|
||||
|
@ -228,7 +203,7 @@ jobs:
|
|||
uses: actions/cache@v3
|
||||
with:
|
||||
path: nox.${{ inputs.distro-slug }}.tar.*
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ matrix.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
|
||||
- name: Decompress .nox Directory
|
||||
run: |
|
||||
|
@ -236,6 +211,7 @@ jobs:
|
|||
|
||||
- name: Show System Info & Test Plan
|
||||
env:
|
||||
SALT_RELEASE: "${{ inputs.salt-version }}"
|
||||
SKIP_REQUIREMENTS_INSTALL: "1"
|
||||
PRINT_TEST_SELECTION: "1"
|
||||
PRINT_TEST_PLAN_ONLY: "1"
|
||||
|
@ -257,7 +233,7 @@ jobs:
|
|||
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
|
||||
SKIP_CODE_COVERAGE: "${{ inputs.skip-code-coverage && '1' || '0' }}"
|
||||
SALT_RELEASE: "${{ inputs.salt-version }}"
|
||||
SALT_REPO_ARCH: ${{ matrix.arch }}
|
||||
SALT_REPO_ARCH: ${{ inputs.arch }}
|
||||
SALT_REPO_TYPE: ${{ inputs.environment }}
|
||||
SALT_REPO_USER: ${{ secrets.SALT_REPO_USER }}
|
||||
SALT_REPO_PASS: ${{ secrets.SALT_REPO_PASS }}
|
||||
|
@ -288,24 +264,19 @@ jobs:
|
|||
if: always() && job.status != 'cancelled'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ matrix.arch }}
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}
|
||||
path: |
|
||||
artifacts
|
||||
!artifacts/salt/*
|
||||
!artifacts/salt-*.tar.*
|
||||
|
||||
report:
|
||||
name: Reports for ${{ inputs.distro-slug }}(${{ matrix.arch }})
|
||||
name: Reports for ${{ inputs.distro-slug }}(${{ inputs.arch }})
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment }}
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
needs:
|
||||
- test
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.test-matrix-include) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
|
@ -315,7 +286,7 @@ jobs:
|
|||
id: download-test-run-artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ matrix.arch }}
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}
|
||||
path: artifacts
|
||||
|
||||
- name: Show Test Run Artifacts
|
||||
|
@ -337,6 +308,6 @@ jobs:
|
|||
# always run even if the previous steps fails
|
||||
if: always() && github.event_name == 'push' && steps.download-test-run-artifacts.outcome == 'success'
|
||||
with:
|
||||
check_name: Overall Test Results(${{ inputs.distro-slug }} ${{ matrix.arch }})
|
||||
check_name: Overall Test Results(${{ inputs.distro-slug }} ${{ inputs.arch }})
|
||||
report_paths: 'artifacts/xml-unittests-output/*.xml'
|
||||
annotate_only: true
|
||||
|
|
|
@ -11,6 +11,14 @@ on:
|
|||
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
|
||||
|
@ -67,40 +75,13 @@ env:
|
|||
|
||||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Generate Package Test Matrix
|
||||
runs-on:
|
||||
- self-hosted
|
||||
- linux
|
||||
- x86_64
|
||||
outputs:
|
||||
arch-matrix-include: ${{ steps.generate-pkg-matrix.outputs.arch }}
|
||||
test-matrix-include: ${{ steps.generate-pkg-matrix.outputs.tests }}
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
|
||||
- name: Generate Package Test Matrix
|
||||
id: generate-pkg-matrix
|
||||
run: |
|
||||
tools ci pkg-download-matrix windows
|
||||
|
||||
dependencies:
|
||||
name: Setup Test Dependencies
|
||||
needs:
|
||||
- generate-matrix
|
||||
runs-on:
|
||||
- self-hosted
|
||||
- linux
|
||||
- bastion
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.arch-matrix-include) }}
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -110,13 +91,13 @@ jobs:
|
|||
uses: actions/cache@v3
|
||||
with:
|
||||
path: nox.${{ inputs.distro-slug }}.tar.*
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ matrix.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact
|
||||
if: inputs.artifacts-from-workflow == ''
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Download Onedir Tarball as an Artifact(from a different workflow)
|
||||
|
@ -127,7 +108,7 @@ jobs:
|
|||
workflow_conclusion: ""
|
||||
branch: ${{ github.event.ref }}
|
||||
if_no_artifact_found: fail
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
|
@ -136,7 +117,7 @@ jobs:
|
|||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
|
||||
|
@ -193,8 +174,8 @@ jobs:
|
|||
- name: Upload Onedir Tarball as an Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
path: artifacts/${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz*
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz*
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
|
@ -213,12 +194,7 @@ jobs:
|
|||
environment: ${{ inputs.environment }}
|
||||
timeout-minutes: 120 # 2 Hours - More than this and something is wrong
|
||||
needs:
|
||||
- generate-matrix
|
||||
- dependencies
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.test-matrix-include) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
|
@ -227,7 +203,7 @@ jobs:
|
|||
- name: Download Onedir Tarball as an Artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
name: ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
path: artifacts/
|
||||
|
||||
- name: Decompress Onedir Tarball
|
||||
|
@ -235,13 +211,13 @@ jobs:
|
|||
run: |
|
||||
python3 -c "import os; os.makedirs('artifacts', exist_ok=True)"
|
||||
cd artifacts
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ matrix.arch }}.tar.xz
|
||||
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ inputs.platform }}-${{ inputs.arch }}.tar.xz
|
||||
|
||||
- name: Download cached nox.${{ inputs.distro-slug }}.tar.* for session ${{ inputs.nox-session }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: nox.${{ inputs.distro-slug }}.tar.*
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ matrix.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
|
||||
|
||||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
|
@ -271,9 +247,9 @@ jobs:
|
|||
|
||||
- name: Show System Info & Test Plan
|
||||
env:
|
||||
INSTALL_TYPE: ${{ matrix.install_type }}
|
||||
INSTALL_TYPE: ${{ inputs.pkg-type }}
|
||||
SALT_RELEASE: "${{ inputs.salt-version }}"
|
||||
SALT_REPO_ARCH: ${{ matrix.install_arch }}
|
||||
SALT_REPO_ARCH: ${{ inputs.arch }}
|
||||
SALT_REPO_TYPE: ${{ inputs.environment }}
|
||||
SALT_REPO_USER: ${{ secrets.SALT_REPO_USER }}
|
||||
SALT_REPO_PASS: ${{ secrets.SALT_REPO_PASS }}
|
||||
|
@ -288,9 +264,9 @@ jobs:
|
|||
|
||||
- name: Run Package Download Tests
|
||||
env:
|
||||
INSTALL_TYPE: ${{ matrix.install_type }}
|
||||
INSTALL_TYPE: ${{ inputs.pkg-type }}
|
||||
SALT_RELEASE: "${{ inputs.salt-version }}"
|
||||
SALT_REPO_ARCH: ${{ matrix.install_arch }}
|
||||
SALT_REPO_ARCH: ${{ inputs.arch }}
|
||||
SALT_REPO_TYPE: ${{ inputs.environment }}
|
||||
SALT_REPO_USER: ${{ secrets.SALT_REPO_USER }}
|
||||
SALT_REPO_PASS: ${{ secrets.SALT_REPO_PASS }}
|
||||
|
@ -331,24 +307,19 @@ jobs:
|
|||
if: always() && steps.download-artifacts-from-vm.outcome == 'success'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ matrix.arch }}
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}
|
||||
path: |
|
||||
artifacts
|
||||
!artifacts/salt/*
|
||||
!artifacts/salt-*.tar.*
|
||||
|
||||
report:
|
||||
name: Reports for ${{ inputs.distro-slug }}(${{ matrix.arch }})
|
||||
name: Reports for ${{ inputs.distro-slug }}(${{ inputs.arch }})
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment }}
|
||||
if: always() && needs.test.result != 'cancelled' && needs.test.result != 'skipped'
|
||||
needs:
|
||||
- test
|
||||
- generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.generate-matrix.outputs.test-matrix-include) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
|
@ -358,7 +329,7 @@ jobs:
|
|||
id: download-test-run-artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ matrix.arch }}
|
||||
name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}
|
||||
path: artifacts
|
||||
|
||||
- name: Show Test Run Artifacts
|
||||
|
@ -380,6 +351,6 @@ jobs:
|
|||
# always run even if the previous steps fails
|
||||
if: always() && github.event_name == 'push' && steps.download-test-run-artifacts.outcome == 'success'
|
||||
with:
|
||||
check_name: Overall Test Results(${{ inputs.distro-slug }} ${{ matrix.arch }})
|
||||
check_name: Overall Test Results(${{ inputs.distro-slug }} ${{ inputs.arch }} ${{ inputs.pkg-type }} )
|
||||
report_paths: 'artifacts/xml-unittests-output/*.xml'
|
||||
annotate_only: true
|
||||
|
|
41
tools/ci.py
41
tools/ci.py
|
@ -645,44 +645,3 @@ def pkg_matrix(ctx: Context, distro_slug: str, pkg_type: str):
|
|||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"matrix={json.dumps(matrix)}\n")
|
||||
ctx.exit(0)
|
||||
|
||||
|
||||
@ci.command(
|
||||
name="pkg-download-matrix",
|
||||
arguments={
|
||||
"platform": {
|
||||
"help": "The OS platform to generate the matrix for",
|
||||
"choices": ("linux", "windows", "macos", "darwin"),
|
||||
},
|
||||
},
|
||||
)
|
||||
def pkg_download_matrix(ctx: Context, platform: str):
|
||||
"""
|
||||
Generate the test matrix.
|
||||
"""
|
||||
github_output = os.environ.get("GITHUB_OUTPUT")
|
||||
if github_output is None:
|
||||
ctx.warn("The 'GITHUB_OUTPUT' variable is not set.")
|
||||
|
||||
tests = []
|
||||
arches = []
|
||||
if platform == "windows":
|
||||
for arch in ("amd64", "x86"):
|
||||
arches.append({"arch": arch})
|
||||
for install_type in ("msi", "nsis"):
|
||||
tests.append({"arch": arch, "install_type": install_type})
|
||||
else:
|
||||
for arch in ("x86_64", "aarch64"):
|
||||
if platform in ("macos", "darwin") and arch == "aarch64":
|
||||
continue
|
||||
arches.append({"arch": arch})
|
||||
tests.append({"arch": arch})
|
||||
ctx.info("Generated arch matrix:")
|
||||
ctx.print(arches, soft_wrap=True)
|
||||
ctx.info("Generated test matrix:")
|
||||
ctx.print(tests, soft_wrap=True)
|
||||
if github_output is not None:
|
||||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"arch={json.dumps(arches)}\n")
|
||||
wfh.write(f"tests={json.dumps(tests)}\n")
|
||||
ctx.exit(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue