From 28f30b1de01f7312e0ecead39171a71bc8bb8c44 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 12 May 2024 07:41:20 +0100 Subject: [PATCH 1/4] Reduce number of artifacts by merging them --- .github/workflows/ci.yml | 12 +++++- .github/workflows/nightly.yml | 12 +++++- .github/workflows/scheduled.yml | 12 +++++- .github/workflows/templates/ci.yml.jinja | 12 +++++- .github/workflows/test-action-linux.yml | 39 +++++++++++++++---- .github/workflows/test-action-macos.yml | 29 +++++++++++++- .github/workflows/test-action-windows.yml | 29 +++++++++++++- .../workflows/test-packages-action-linux.yml | 17 ++++---- .../workflows/test-packages-action-macos.yml | 17 ++++---- .../test-packages-action-windows.yml | 17 ++++---- 10 files changed, 156 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdaaa98fc646..8870e0dd5ae0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1808,12 +1808,20 @@ jobs: + - name: Merge All Code Coverage Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + id: merge-coverage-artifacts + with: + name: all-testrun-coverage-artifacts + pattern: all-testrun-coverage-artifacts-* + separate-directories: false + delete-merged: true + - name: Get coverage reports id: get-coverage-reports uses: actions/download-artifact@v4 with: - pattern: all-testrun-coverage-artifacts-* - merge-multiple: true + name: all-testrun-coverage-artifacts path: artifacts/coverage/ - name: Display structure of downloaded files diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0401a7ff4b72..2e5d1d471932 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1870,12 +1870,20 @@ jobs: + - name: Merge All Code Coverage Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + id: merge-coverage-artifacts + with: + name: all-testrun-coverage-artifacts + pattern: all-testrun-coverage-artifacts-* + separate-directories: false + delete-merged: true + - name: Get coverage reports id: get-coverage-reports uses: actions/download-artifact@v4 with: - pattern: all-testrun-coverage-artifacts-* - merge-multiple: true + name: all-testrun-coverage-artifacts path: artifacts/coverage/ - name: Display structure of downloaded files diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 0af64b9284c8..032ee217618b 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1847,12 +1847,20 @@ jobs: + - name: Merge All Code Coverage Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + id: merge-coverage-artifacts + with: + name: all-testrun-coverage-artifacts + pattern: all-testrun-coverage-artifacts-* + separate-directories: false + delete-merged: true + - name: Get coverage reports id: get-coverage-reports uses: actions/download-artifact@v4 with: - pattern: all-testrun-coverage-artifacts-* - merge-multiple: true + name: all-testrun-coverage-artifacts path: artifacts/coverage/ - name: Display structure of downloaded files diff --git a/.github/workflows/templates/ci.yml.jinja b/.github/workflows/templates/ci.yml.jinja index eb5658f374a6..40385489fa05 100644 --- a/.github/workflows/templates/ci.yml.jinja +++ b/.github/workflows/templates/ci.yml.jinja @@ -342,12 +342,20 @@ #} + - name: Merge All Code Coverage Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + id: merge-coverage-artifacts + with: + name: all-testrun-coverage-artifacts + pattern: all-testrun-coverage-artifacts-* + separate-directories: false + delete-merged: true + - name: Get coverage reports id: get-coverage-reports uses: actions/download-artifact@v4 with: - pattern: all-testrun-coverage-artifacts-* - merge-multiple: true + name: all-testrun-coverage-artifacts path: artifacts/coverage/ - name: Display structure of downloaded files diff --git a/.github/workflows/test-action-linux.yml b/.github/workflows/test-action-linux.yml index b55ec755f5c2..33970eead090 100644 --- a/.github/workflows/test-action-linux.yml +++ b/.github/workflows/test-action-linux.yml @@ -79,7 +79,7 @@ env: jobs: generate-matrix: - name: Test Matrix + name: Test Matrix${{ inputs.fips && ' (fips)' || '' }} runs-on: ubuntu-latest outputs: matrix-include: ${{ steps.generate-matrix.outputs.matrix }} @@ -266,7 +266,7 @@ jobs: 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 }}.grp${{ matrix.test-group || '1' }} + mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}.grp${{ matrix.test-group || '1' }}${{ matrix.fips && '-fips ' || '' }} fi - name: Destroy VM @@ -299,7 +299,7 @@ jobs: artifacts/logs report: - name: Test Reports + name: Test Reports${{ inputs.fips && ' (fips)' || '' }} if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && inputs.skip-code-coverage == false && needs.test.result != 'cancelled' && needs.test.result != 'skipped' runs-on: ubuntu-latest needs: @@ -310,13 +310,38 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge JUnit XML Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} + pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + separate-directories: false + delete-merged: true + + - name: Merge Log Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} + pattern: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + separate-directories: false + delete-merged: true + + - name: Merge Code Coverage Test Run Artifacts + uses: actions/upload-artifact/merge@v4 + if: ${{ inputs.skip-code-coverage == false }} + id: merge-coverage-artifacts + with: + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} + pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + 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: - pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-* - merge-multiple: true + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} path: artifacts/coverage/ - name: Show Downloaded Test Run Artifacts @@ -350,11 +375,11 @@ jobs: 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 }} + mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}${{ inputs.fips && '.fips ' || '' }} - 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 }} + name: all-testrun-coverage-artifacts-${{ inputs.distro-slug }}.${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} path: artifacts/coverage diff --git a/.github/workflows/test-action-macos.yml b/.github/workflows/test-action-macos.yml index 1da200b6ae70..00b22518ba16 100644 --- a/.github/workflows/test-action-macos.yml +++ b/.github/workflows/test-action-macos.yml @@ -338,13 +338,38 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge JUnit XML Test Run Artifacts + 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 + 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 + uses: actions/upload-artifact/merge@v4 + if: ${{ inputs.skip-code-coverage == false }} + id: merge-coverage-artifacts + 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: - pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-* - merge-multiple: true + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }} path: artifacts/coverage/ - name: Show Downloaded Test Run Artifacts diff --git a/.github/workflows/test-action-windows.yml b/.github/workflows/test-action-windows.yml index 65c407f69f9a..69a128732a98 100644 --- a/.github/workflows/test-action-windows.yml +++ b/.github/workflows/test-action-windows.yml @@ -311,13 +311,38 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge JUnit XML Test Run Artifacts + 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 + 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 + uses: actions/upload-artifact/merge@v4 + if: ${{ inputs.skip-code-coverage == false }} + id: merge-coverage-artifacts + 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: - pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-* - merge-multiple: true + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }} path: artifacts/coverage/ - name: Show Downloaded Test Run Artifacts diff --git a/.github/workflows/test-packages-action-linux.yml b/.github/workflows/test-packages-action-linux.yml index 2197a6623188..6020d7b7ec38 100644 --- a/.github/workflows/test-packages-action-linux.yml +++ b/.github/workflows/test-packages-action-linux.yml @@ -221,7 +221,7 @@ jobs: if: always() && steps.download-artifacts-from-vm.outcome == 'success' uses: actions/upload-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} path: | artifacts !artifacts/pkg/* @@ -234,21 +234,24 @@ jobs: if: always() && inputs.skip-code-coverage == false && needs.test.result != 'cancelled' && needs.test.result != 'skipped' needs: - test - - generate-matrix - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }} steps: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge Test Run Artifacts + 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: Download Test Run Artifacts id: download-test-run-artifacts uses: actions/download-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }} path: artifacts - name: Show Test Run Artifacts diff --git a/.github/workflows/test-packages-action-macos.yml b/.github/workflows/test-packages-action-macos.yml index 686295cb17be..1716f2a0e091 100644 --- a/.github/workflows/test-packages-action-macos.yml +++ b/.github/workflows/test-packages-action-macos.yml @@ -204,7 +204,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} path: | artifacts !artifacts/pkg/* @@ -217,21 +217,24 @@ jobs: if: always() && inputs.skip-code-coverage == false && needs.test.result != 'cancelled' && needs.test.result != 'skipped' needs: - test - - generate-matrix - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }} steps: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge Test Run Artifacts + 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: Download Test Run Artifacts id: download-test-run-artifacts uses: actions/download-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }} path: artifacts - name: Show Test Run Artifacts diff --git a/.github/workflows/test-packages-action-windows.yml b/.github/workflows/test-packages-action-windows.yml index b8d2f21d5bd5..72cab193bcf8 100644 --- a/.github/workflows/test-packages-action-windows.yml +++ b/.github/workflows/test-packages-action-windows.yml @@ -220,7 +220,7 @@ jobs: if: always() && steps.download-artifacts-from-vm.outcome == 'success' uses: actions/upload-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} path: | artifacts !artifacts/pkg/* @@ -233,21 +233,24 @@ jobs: if: always() && inputs.skip-code-coverage == false && needs.test.result != 'cancelled' && needs.test.result != 'skipped' needs: - test - - generate-matrix - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON(needs.generate-matrix.outputs.pkg-matrix-include) }} steps: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Merge Test Run Artifacts + 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: Download Test Run Artifacts id: download-test-run-artifacts uses: actions/download-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.arch }}-${{ inputs.pkg-type }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }} path: artifacts - name: Show Test Run Artifacts From 56729e1e3f335558730a416c844264d68e6099b3 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 12 May 2024 18:44:32 +0100 Subject: [PATCH 2/4] Differentiate FIPS test runs --- .github/workflows/ci.yml | 188 +++++++++++++++++- .github/workflows/nightly.yml | 188 +++++++++++++++++- .github/workflows/scheduled.yml | 188 +++++++++++++++++- .github/workflows/staging.yml | 184 ++++++++++++++++- .../templates/test-salt-pkg.yml.jinja | 4 +- .../workflows/templates/test-salt.yml.jinja | 7 +- .github/workflows/test-action-linux.yml | 48 ++--- .../workflows/test-packages-action-linux.yml | 12 +- tools/ci.py | 44 ++-- tools/precommit/workflows.py | 32 +++ 10 files changed, 812 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8870e0dd5ae0..61259e79d68c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -770,7 +770,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-4-arm64-pkg-tests: name: Photon OS 4 Arm64 Package Test @@ -792,6 +791,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-4-pkg-tests-fips: + name: Photon OS 4 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-4') }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-4-arm64-pkg-tests-fips: + name: Photon OS 4 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-4-arm64') }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true photonos-5-pkg-tests: @@ -814,7 +856,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-5-arm64-pkg-tests: name: Photon OS 5 Arm64 Package Test @@ -836,6 +877,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-5-pkg-tests-fips: + name: Photon OS 5 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-5') }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-5-arm64-pkg-tests-fips: + name: Photon OS 5 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true ubuntu-2004-pkg-tests: @@ -1599,7 +1683,6 @@ jobs: skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} workflow-slug: ci default-timeout: 180 - fips: true photonos-4-arm64: name: Photon OS 4 Arm64 Test @@ -1621,6 +1704,49 @@ jobs: skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} workflow-slug: ci default-timeout: 180 + + photonos-4-fips: + name: Photon OS 4 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-4') }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + workflow-slug: ci + default-timeout: 180 + fips: true + + photonos-4-arm64-fips: + name: Photon OS 4 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-4-arm64') }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + workflow-slug: ci + default-timeout: 180 fips: true photonos-5: @@ -1643,7 +1769,6 @@ jobs: skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} workflow-slug: ci default-timeout: 180 - fips: true photonos-5-arm64: name: Photon OS 5 Arm64 Test @@ -1665,6 +1790,49 @@ jobs: skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} workflow-slug: ci default-timeout: 180 + + photonos-5-fips: + name: Photon OS 5 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] && contains(fromJSON(needs.prepare-workflow.outputs.os-labels), 'photonos-5') }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + workflow-slug: ci + default-timeout: 180 + fips: true + + photonos-5-arm64-fips: + name: Photon OS 5 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} + workflow-slug: ci + default-timeout: 180 fips: true ubuntu-2004: @@ -1782,8 +1950,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -1944,8 +2116,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -1965,8 +2141,12 @@ jobs: - debian-12-arm64-pkg-tests - photonos-4-pkg-tests - photonos-4-arm64-pkg-tests + - photonos-4-pkg-tests-fips + - photonos-4-arm64-pkg-tests-fips - photonos-5-pkg-tests - photonos-5-arm64-pkg-tests + - photonos-5-pkg-tests-fips + - photonos-5-arm64-pkg-tests-fips - ubuntu-2004-pkg-tests - ubuntu-2004-arm64-pkg-tests - ubuntu-2204-pkg-tests diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2e5d1d471932..bcfef43b4e64 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -832,7 +832,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-4-arm64-pkg-tests: name: Photon OS 4 Arm64 Package Test @@ -854,6 +853,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-4-pkg-tests-fips: + name: Photon OS 4 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-4-arm64-pkg-tests-fips: + name: Photon OS 4 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true photonos-5-pkg-tests: @@ -876,7 +918,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-5-arm64-pkg-tests: name: Photon OS 5 Arm64 Package Test @@ -898,6 +939,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-5-pkg-tests-fips: + name: Photon OS 5 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-5-arm64-pkg-tests-fips: + name: Photon OS 5 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true ubuntu-2004-pkg-tests: @@ -1661,7 +1745,6 @@ jobs: skip-code-coverage: false workflow-slug: nightly default-timeout: 360 - fips: true photonos-4-arm64: name: Photon OS 4 Arm64 Test @@ -1683,6 +1766,49 @@ jobs: skip-code-coverage: false workflow-slug: nightly default-timeout: 360 + + photonos-4-fips: + name: Photon OS 4 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: nightly + default-timeout: 360 + fips: true + + photonos-4-arm64-fips: + name: Photon OS 4 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: nightly + default-timeout: 360 fips: true photonos-5: @@ -1705,7 +1831,6 @@ jobs: skip-code-coverage: false workflow-slug: nightly default-timeout: 360 - fips: true photonos-5-arm64: name: Photon OS 5 Arm64 Test @@ -1727,6 +1852,49 @@ jobs: skip-code-coverage: false workflow-slug: nightly default-timeout: 360 + + photonos-5-fips: + name: Photon OS 5 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: nightly + default-timeout: 360 + fips: true + + photonos-5-arm64-fips: + name: Photon OS 5 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: nightly + default-timeout: 360 fips: true ubuntu-2004: @@ -1844,8 +2012,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -2758,8 +2930,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -2837,8 +3013,12 @@ jobs: - debian-12-arm64-pkg-tests - photonos-4-pkg-tests - photonos-4-arm64-pkg-tests + - photonos-4-pkg-tests-fips + - photonos-4-arm64-pkg-tests-fips - photonos-5-pkg-tests - photonos-5-arm64-pkg-tests + - photonos-5-pkg-tests-fips + - photonos-5-arm64-pkg-tests-fips - ubuntu-2004-pkg-tests - ubuntu-2004-arm64-pkg-tests - ubuntu-2204-pkg-tests diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 032ee217618b..d803400ca89e 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -809,7 +809,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-4-arm64-pkg-tests: name: Photon OS 4 Arm64 Package Test @@ -831,6 +830,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-4-pkg-tests-fips: + name: Photon OS 4 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-4-arm64-pkg-tests-fips: + name: Photon OS 4 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true photonos-5-pkg-tests: @@ -853,7 +895,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-5-arm64-pkg-tests: name: Photon OS 5 Arm64 Package Test @@ -875,6 +916,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-5-pkg-tests-fips: + name: Photon OS 5 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-5-arm64-pkg-tests-fips: + name: Photon OS 5 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true ubuntu-2004-pkg-tests: @@ -1638,7 +1722,6 @@ jobs: skip-code-coverage: false workflow-slug: scheduled default-timeout: 360 - fips: true photonos-4-arm64: name: Photon OS 4 Arm64 Test @@ -1660,6 +1743,49 @@ jobs: skip-code-coverage: false workflow-slug: scheduled default-timeout: 360 + + photonos-4-fips: + name: Photon OS 4 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: scheduled + default-timeout: 360 + fips: true + + photonos-4-arm64-fips: + name: Photon OS 4 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: scheduled + default-timeout: 360 fips: true photonos-5: @@ -1682,7 +1808,6 @@ jobs: skip-code-coverage: false workflow-slug: scheduled default-timeout: 360 - fips: true photonos-5-arm64: name: Photon OS 5 Arm64 Test @@ -1704,6 +1829,49 @@ jobs: skip-code-coverage: false workflow-slug: scheduled default-timeout: 360 + + photonos-5-fips: + name: Photon OS 5 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: scheduled + default-timeout: 360 + fips: true + + photonos-5-arm64-fips: + name: Photon OS 5 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: false + workflow-slug: scheduled + default-timeout: 360 fips: true ubuntu-2004: @@ -1821,8 +1989,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -1985,8 +2157,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -2006,8 +2182,12 @@ jobs: - debian-12-arm64-pkg-tests - photonos-4-pkg-tests - photonos-4-arm64-pkg-tests + - photonos-4-pkg-tests-fips + - photonos-4-arm64-pkg-tests-fips - photonos-5-pkg-tests - photonos-5-arm64-pkg-tests + - photonos-5-pkg-tests-fips + - photonos-5-arm64-pkg-tests-fips - ubuntu-2004-pkg-tests - ubuntu-2004-arm64-pkg-tests - ubuntu-2204-pkg-tests diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index c3c3db9d8b4e..9ac296e5fcd1 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -817,7 +817,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-4-arm64-pkg-tests: name: Photon OS 4 Arm64 Package Test @@ -839,6 +838,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-4-pkg-tests-fips: + name: Photon OS 4 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-4-arm64-pkg-tests-fips: + name: Photon OS 4 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true photonos-5-pkg-tests: @@ -861,7 +903,6 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} - fips: true photonos-5-arm64-pkg-tests: name: Photon OS 5 Arm64 Package Test @@ -883,6 +924,49 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 skip-code-coverage: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + + photonos-5-pkg-tests-fips: + name: Photon OS 5 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} + fips: true + + photonos-5-arm64-pkg-tests-fips: + name: Photon OS 5 Arm64 Package Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-pkgs-onedir + - build-ci-deps + uses: ./.github/workflows/test-packages-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + pkg-type: rpm + nox-version: 2022.8.7 + python-version: "3.10" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} fips: true ubuntu-2004-pkg-tests: @@ -1646,7 +1730,6 @@ jobs: skip-code-coverage: true workflow-slug: staging default-timeout: 180 - fips: true photonos-4-arm64: name: Photon OS 4 Arm64 Test @@ -1668,6 +1751,49 @@ jobs: skip-code-coverage: true workflow-slug: staging default-timeout: 180 + + photonos-4-fips: + name: Photon OS 4 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + workflow-slug: staging + default-timeout: 180 + fips: true + + photonos-4-arm64-fips: + name: Photon OS 4 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-4-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + workflow-slug: staging + default-timeout: 180 fips: true photonos-5: @@ -1690,7 +1816,6 @@ jobs: skip-code-coverage: true workflow-slug: staging default-timeout: 180 - fips: true photonos-5-arm64: name: Photon OS 5 Arm64 Test @@ -1712,6 +1837,49 @@ jobs: skip-code-coverage: true workflow-slug: staging default-timeout: 180 + + photonos-5-fips: + name: Photon OS 5 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5 + nox-session: ci-test-onedir + platform: linux + arch: x86_64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + workflow-slug: staging + default-timeout: 180 + fips: true + + photonos-5-arm64-fips: + name: Photon OS 5 Arm64 Test (fips) + if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} + needs: + - prepare-workflow + - build-ci-deps + uses: ./.github/workflows/test-action-linux.yml + with: + distro-slug: photonos-5-arm64 + nox-session: ci-test-onedir + platform: linux + arch: arm64 + nox-version: 2022.8.7 + gh-actions-python-version: "3.10" + testrun: ${{ needs.prepare-workflow.outputs.testrun }} + salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.14 + skip-code-coverage: true + workflow-slug: staging + default-timeout: 180 fips: true ubuntu-2004: @@ -2724,8 +2892,12 @@ jobs: - opensuse-15 - photonos-4 - photonos-4-arm64 + - photonos-4-fips + - photonos-4-arm64-fips - photonos-5 - photonos-5-arm64 + - photonos-5-fips + - photonos-5-arm64-fips - ubuntu-2004 - ubuntu-2004-arm64 - ubuntu-2204 @@ -2745,8 +2917,12 @@ jobs: - debian-12-arm64-pkg-tests - photonos-4-pkg-tests - photonos-4-arm64-pkg-tests + - photonos-4-pkg-tests-fips + - photonos-4-arm64-pkg-tests-fips - photonos-5-pkg-tests - photonos-5-arm64-pkg-tests + - photonos-5-pkg-tests-fips + - photonos-5-arm64-pkg-tests-fips - ubuntu-2004-pkg-tests - ubuntu-2004-arm64-pkg-tests - ubuntu-2204-pkg-tests diff --git a/.github/workflows/templates/test-salt-pkg.yml.jinja b/.github/workflows/templates/test-salt-pkg.yml.jinja index 1a34ad8e7fdf..5feb9bf3dbed 100644 --- a/.github/workflows/templates/test-salt-pkg.yml.jinja +++ b/.github/workflows/templates/test-salt-pkg.yml.jinja @@ -1,9 +1,9 @@ <%- for os in test_salt_pkg_listing["linux"] %> - <%- set job_name = "{}-pkg-tests".format(os.slug.replace(".", "")) %> + <%- set job_name = "{}-pkg-tests{}".format(os.slug.replace(".", ""), os.fips and '-fips' or '') %> <{ job_name }>: <%- do test_salt_pkg_needs.append(job_name) %> - name: <{ os.display_name }> Package Test + name: <{ os.display_name }> Package Test<%- if os.fips %> (fips)<%- endif %> <%- if workflow_slug != "ci" or os.slug in mandatory_os_slugs %> if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test-pkg'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} <%- else %> diff --git a/.github/workflows/templates/test-salt.yml.jinja b/.github/workflows/templates/test-salt.yml.jinja index 7e89bf57994a..67d61ba3f1cd 100644 --- a/.github/workflows/templates/test-salt.yml.jinja +++ b/.github/workflows/templates/test-salt.yml.jinja @@ -67,10 +67,11 @@ <%- endfor %> <%- for os in test_salt_listing["linux"] %> + <%- set job_name = "{}{}".format(os.slug.replace(".", ""), os.fips and '-fips' or '') %> - <{ os.slug.replace(".", "") }>: - <%- do test_salt_needs.append(os.slug.replace(".", "")) %> - name: <{ os.display_name }> Test + <{ job_name }>: + <%- do test_salt_needs.append(job_name) %> + name: <{ os.display_name }> Test<%- if os.fips %> (fips)<%- endif %> <%- if workflow_slug != "ci" or os.slug in mandatory_os_slugs %> if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['test'] && fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} <%- else %> diff --git a/.github/workflows/test-action-linux.yml b/.github/workflows/test-action-linux.yml index 33970eead090..70f0ed019356 100644 --- a/.github/workflows/test-action-linux.yml +++ b/.github/workflows/test-action-linux.yml @@ -79,7 +79,7 @@ env: jobs: generate-matrix: - name: Test Matrix${{ inputs.fips && ' (fips)' || '' }} + name: Test Matrix runs-on: ubuntu-latest outputs: matrix-include: ${{ steps.generate-matrix.outputs.matrix }} @@ -102,7 +102,7 @@ jobs: - 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 }} + tools ci matrix --workflow=${{ inputs.workflow-slug }} ${{ fromJSON(inputs.testrun)['type'] == 'full' && '--full ' || '' }}${{ inputs.distro-slug }} test: name: Test @@ -206,7 +206,7 @@ jobs: if: ${{ fromJSON(inputs.testrun)['type'] != 'full' }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ - --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ + --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ ${{ matrix.tests-chunk }} -- --core-tests --slow-tests --suppress-no-test-exit-code \ --from-filenames=testrun-changed-files.txt @@ -216,14 +216,14 @@ jobs: run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ (inputs.skip-code-coverage && matrix.tests-chunk != 'unit') && '--skip-code-coverage' || '' }} \ - ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} + ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} - name: Run Slow Tests id: run-slow-tests if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ - --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ + --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ ${{ matrix.tests-chunk }} -- --no-fast-tests --slow-tests - name: Run Core Tests @@ -231,7 +231,7 @@ jobs: if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ - --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ + --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ ${{ matrix.tests-chunk }} -- --no-fast-tests --core-tests - name: Run Flaky Tests @@ -239,7 +239,7 @@ jobs: if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ - --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ + --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ ${{ matrix.tests-chunk }} -- --no-fast-tests --flaky-jail - name: Run Full Tests @@ -248,7 +248,7 @@ jobs: run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ (inputs.skip-code-coverage && matrix.tests-chunk != 'unit') && '--skip-code-coverage' || '' }} \ - -E TEST_GROUP ${{ matrix.fips && '--fips ' || '' }}${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} -- --slow-tests --core-tests \ + -E TEST_GROUP ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} -- --slow-tests --core-tests \ --test-group-count=${{ matrix.test-group-count || 1 }} --test-group=${{ matrix.test-group || 1 }} - name: Combine Coverage Reports @@ -266,7 +266,7 @@ jobs: 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 }}.grp${{ matrix.test-group || '1' }}${{ matrix.fips && '-fips ' || '' }} + mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}${{ inputs.fips && '.fips' || '' }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}.grp${{ matrix.test-group || '1' }} fi - name: Destroy VM @@ -278,7 +278,7 @@ jobs: 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 }}-grp${{ matrix.test-group || '1' }}${{ matrix.fips && '-fips ' || '' }} + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-grp${{ matrix.test-group || '1' }} path: | artifacts/coverage/ @@ -286,7 +286,7 @@ jobs: 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 }}-grp${{ matrix.test-group || '1' }}${{ matrix.fips && '-fips ' || '' }} + name: testrun-junit-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-grp${{ matrix.test-group || '1' }} path: | artifacts/xml-unittests-output/ @@ -294,12 +294,12 @@ jobs: 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 }}-grp${{ matrix.test-group || '1' }}${{ matrix.fips && '-fips ' || '' }} + name: testrun-log-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-${{ matrix.transport }}-${{ matrix.tests-chunk }}-grp${{ matrix.test-group || '1' }} path: | artifacts/logs report: - name: Test Reports${{ inputs.fips && ' (fips)' || '' }} + name: Test Reports if: always() && fromJSON(needs.generate-matrix.outputs.build-reports) && inputs.skip-code-coverage == false && needs.test.result != 'cancelled' && needs.test.result != 'skipped' runs-on: ubuntu-latest needs: @@ -313,16 +313,16 @@ jobs: - name: Merge JUnit XML Test Run Artifacts uses: actions/upload-artifact/merge@v4 with: - name: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} - pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + name: testrun-junit-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }} + pattern: testrun-junit-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-* separate-directories: false delete-merged: true - name: Merge Log Test Run Artifacts uses: actions/upload-artifact/merge@v4 with: - name: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} - pattern: testrun-log-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + name: testrun-log-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }} + pattern: testrun-log-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-* separate-directories: false delete-merged: true @@ -331,8 +331,8 @@ jobs: if: ${{ inputs.skip-code-coverage == false }} id: merge-coverage-artifacts with: - name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} - pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}-*${{ inputs.fips && '-fips ' || '' }} + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }} + pattern: testrun-coverage-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }}-* separate-directories: false delete-merged: true @@ -341,7 +341,7 @@ jobs: if: ${{ inputs.skip-code-coverage == false }} id: download-coverage-artifacts with: - name: testrun-coverage-artifacts-${{ inputs.distro-slug }}-${{ inputs.nox-session }}${{ inputs.fips && '-fips ' || '' }} + name: testrun-coverage-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }} path: artifacts/coverage/ - name: Show Downloaded Test Run Artifacts @@ -356,8 +356,8 @@ jobs: 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 + mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}${{ inputs.fips && '..fips' || '' }}..${{ inputs.nox-session }}.xml + mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}${{ inputs.fips && '..fips' || '' }}..${{ inputs.nox-session }}.xml - name: Report Salt Code Coverage if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' @@ -375,11 +375,11 @@ jobs: 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 }}${{ inputs.fips && '.fips ' || '' }} + mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}${{ inputs.fips && '.fips' || '' }}.${{ 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 }}${{ inputs.fips && '-fips ' || '' }} + name: all-testrun-coverage-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.nox-session }} path: artifacts/coverage diff --git a/.github/workflows/test-packages-action-linux.yml b/.github/workflows/test-packages-action-linux.yml index 6020d7b7ec38..fc243e83baa4 100644 --- a/.github/workflows/test-packages-action-linux.yml +++ b/.github/workflows/test-packages-action-linux.yml @@ -101,7 +101,7 @@ jobs: - name: Generate Package Test Matrix id: generate-pkg-matrix run: | - tools ci pkg-matrix ${{ inputs.fips && '--fips ' || '' }}${{ inputs.distro-slug }} \ + tools ci pkg-matrix ${{ inputs.distro-slug }} \ ${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }} @@ -198,7 +198,7 @@ jobs: - name: Run Package Tests run: | - tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install ${{ matrix.fips && '--fips ' || '' }}\ + tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install ${{ inputs.fips && '--fips ' || '' }}\ --nox-session=${{ inputs.nox-session }}-pkgs --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.tests-chunk }} \ ${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}} @@ -221,7 +221,7 @@ jobs: if: always() && steps.download-artifacts-from-vm.outcome == 'success' 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'}} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }}-${{ inputs.arch }}-${{ matrix.tests-chunk }}-${{ matrix.version || 'no-version'}} path: | artifacts !artifacts/pkg/* @@ -242,8 +242,8 @@ jobs: - name: Merge Test Run Artifacts 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 }}-* + 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 @@ -251,7 +251,7 @@ jobs: id: download-test-run-artifacts uses: actions/download-artifact@v4 with: - name: pkg-testrun-artifacts-${{ inputs.distro-slug }}-${{ inputs.pkg-type }} + name: pkg-testrun-artifacts-${{ inputs.distro-slug }}${{ inputs.fips && '-fips' || '' }}-${{ inputs.pkg-type }} path: artifacts - name: Show Test Run Artifacts diff --git a/tools/ci.py b/tools/ci.py index 3ad2b20144cb..8a09af5bc050 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -643,9 +643,6 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): "workflow": { "help": "Which workflow is running", }, - "fips": { - "help": "Include FIPS entries in the matrix", - }, }, ) def matrix( @@ -653,7 +650,6 @@ def matrix( distro_slug: str, full: bool = False, workflow: str = "ci", - fips: bool = False, ): """ Generate the test matrix. @@ -713,18 +709,8 @@ def matrix( "test-group-count": splits, } ) - if fips is True and distro_slug.startswith( - ("photonos-4", "photonos-5") - ): - # Repeat the last one, but with fips - _matrix.append({"fips": "fips", **_matrix[-1]}) else: _matrix.append({"transport": transport, "tests-chunk": chunk}) - if fips is True and distro_slug.startswith( - ("photonos-4", "photonos-5") - ): - # Repeat the last one, but with fips - _matrix.append({"fips": "fips", **_matrix[-1]}) ctx.info("Generated matrix:") ctx.print(_matrix, soft_wrap=True) @@ -759,9 +745,6 @@ def matrix( "nargs": "+", "required": True, }, - "fips": { - "help": "Include FIPS entries in the matrix", - }, }, ) def pkg_matrix( @@ -769,7 +752,6 @@ def pkg_matrix( distro_slug: str, pkg_type: str, testing_releases: list[tools.utils.Version] = None, - fips: bool = False, ): """ Generate the test matrix. @@ -913,13 +895,6 @@ def pkg_matrix( "version": str(version), } ) - if ( - backend == "relenv" - and fips is True - and distro_slug.startswith(("photonos-4", "photonos-5")) - ): - # Repeat the last one, but with fips - _matrix.append({"fips": "fips", **_matrix[-1]}) else: ctx.info(f"No {version} ({backend}) for {distro_slug} at {prefix}") @@ -1489,14 +1464,19 @@ def upload_coverage(ctx: Context, reports_path: pathlib.Path, commit_sha: str = flags = fpath.stem else: try: - section, distro_slug, nox_session = fpath.stem.split("..") + section, distro_slug, _, _ = fpath.stem.split("..") + fips = ",fips" except ValueError: - ctx.error( - f"The file {fpath} does not respect the expected naming convention " - "'{salt|tests}.....xml'. Skipping..." - ) - continue - flags = f"{section},{distro_slug}" + fips = "" + try: + section, distro_slug, _ = fpath.stem.split("..") + except ValueError: + ctx.error( + f"The file {fpath} does not respect the expected naming convention " + "'{salt|tests}.....xml'. Skipping..." + ) + continue + flags = f"{section},{distro_slug}{fips}" max_attempts = 3 current_attempt = 0 diff --git a/tools/precommit/workflows.py b/tools/precommit/workflows.py index 61e39995d21b..749804e72bdb 100644 --- a/tools/precommit/workflows.py +++ b/tools/precommit/workflows.py @@ -59,6 +59,10 @@ Linux(slug="debian-12-arm64", display_name="Debian 12 Arm64", arch="arm64"), Linux(slug="fedora-39", display_name="Fedora 39", arch="x86_64"), Linux(slug="opensuse-15", display_name="Opensuse 15", arch="x86_64"), + Linux(slug="photonos-4", display_name="Photon OS 4", arch="x86_64"), + Linux( + slug="photonos-4-arm64", display_name="Photon OS 4 Arm64", arch="arm64" + ), Linux( slug="photonos-4", display_name="Photon OS 4", @@ -71,6 +75,10 @@ arch="arm64", fips=True, ), + Linux(slug="photonos-5", display_name="Photon OS 5", arch="x86_64"), + Linux( + slug="photonos-5-arm64", display_name="Photon OS 5 Arm64", arch="arm64" + ), Linux( slug="photonos-5", display_name="Photon OS 5", @@ -261,6 +269,18 @@ def generate_workflows(ctx: Context): arch="arm64", pkg_type="deb", ), + Linux( + slug="photonos-4", + display_name="Photon OS 4", + arch="x86_64", + pkg_type="rpm", + ), + Linux( + slug="photonos-4-arm64", + display_name="Photon OS 4 Arm64", + arch="arm64", + pkg_type="rpm", + ), Linux( slug="photonos-4", display_name="Photon OS 4", @@ -275,6 +295,18 @@ def generate_workflows(ctx: Context): pkg_type="rpm", fips=True, ), + Linux( + slug="photonos-5", + display_name="Photon OS 5", + arch="x86_64", + pkg_type="rpm", + ), + Linux( + slug="photonos-5-arm64", + display_name="Photon OS 5 Arm64", + arch="arm64", + pkg_type="rpm", + ), Linux( slug="photonos-5", display_name="Photon OS 5", From cf9ef7040f0dff4a7698054b6ef717a093faaf8b Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 10 Apr 2024 17:55:20 +0200 Subject: [PATCH 3/4] Add test for issue 66342 --- .../functional/states/file/test_managed.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/pytests/functional/states/file/test_managed.py b/tests/pytests/functional/states/file/test_managed.py index 76b139c79886..4a12ef163a19 100644 --- a/tests/pytests/functional/states/file/test_managed.py +++ b/tests/pytests/functional/states/file/test_managed.py @@ -1042,3 +1042,26 @@ def test_issue_60203( assert "Unable to manage file" in ret.comment assert "/files/test.tar.gz.sha256" in ret.comment assert "dontshowme" not in ret.comment + + +def test_file_managed_remote_source_does_not_refetch_existing_file_with_correct_digest( + file, tmp_path, grail_scene33_file, grail_scene33_file_hash +): + """ + If an existing file is managed from a remote source and its source hash is + known beforehand, ensure that `file.managed` checks the local file's digest + and if it matches the expected one, does not download the file to the local + cache unnecessarily. + This is especially important when huge files are managed with `keep_source` + set to False. + Issue #64373 + """ + name = tmp_path / "scene33" + name.write_text(grail_scene33_file.read_text()) + ret = file.managed( + str(name), + source="http://127.0.0.1:1337/does/not/exist", + source_hash=grail_scene33_file_hash, + ) + assert ret.result is True + assert not ret.changes From 197676378fab5009f7c5ab1156d835edebe70cde Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 10 Apr 2024 17:56:24 +0200 Subject: [PATCH 4/4] Don't unnecessarily download remote sources to cache --- changelog/66342.fixed.md | 1 + salt/states/file.py | 61 ++++++++++++++++++- .../functional/states/file/test_managed.py | 2 +- 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 changelog/66342.fixed.md diff --git a/changelog/66342.fixed.md b/changelog/66342.fixed.md new file mode 100644 index 000000000000..da57b2926d05 --- /dev/null +++ b/changelog/66342.fixed.md @@ -0,0 +1 @@ +Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash diff --git a/salt/states/file.py b/salt/states/file.py index eae3fbca7986..5b2b1531bca3 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -2501,8 +2501,12 @@ def managed( Set to ``False`` to discard the cached copy of the source file once the state completes. This can be useful for larger files to keep them from taking up space in minion cache. However, keep in mind that discarding - the source file will result in the state needing to re-download the - source file if the state is run again. + the source file might result in the state needing to re-download the + source file if the state is run again. If the source is not a local or + ``salt://`` one, the source hash is known, ``skip_verify`` is not true + and the managed file exists with the correct hash and is not templated, + this is not the case (i.e. remote downloads are avoided if the local hash + matches the expected one). .. versionadded:: 2017.7.3 @@ -3220,6 +3224,59 @@ def managed( if defaults and not isinstance(defaults, dict): return _error(ret, "Defaults must be formed as a dict") + # If we're pulling from a remote source untemplated and we have a source hash, + # check early if the local file exists with the correct hash and skip + # managing contents if so. This avoids a lot of overhead. + if ( + contents is None + and not template + and source + and not skip_verify + and os.path.exists(name) + and replace + ): + try: + # If the source is a list, find the first existing file. + # We're doing this after basic checks to not slow down + # runs where it does not matter. + source, source_hash = __salt__["file.source_list"]( + source, source_hash, __env__ + ) + source_sum = None + if ( + source + and source_hash + and urllib.parse.urlparse(source).scheme + not in ( + "salt", + "file", + ) + and not os.path.isabs(source) + ): + source_sum = __salt__["file.get_source_sum"]( + name, + source, + source_hash, + source_hash_name, + __env__, + verify_ssl=verify_ssl, + source_hash_sig=source_hash_sig, + signed_by_any=signed_by_any, + signed_by_all=signed_by_all, + keyring=keyring, + gnupghome=gnupghome, + ) + hsum = __salt__["file.get_hash"](name, source_sum["hash_type"]) + except (CommandExecutionError, OSError) as err: + log.error( + "Failed checking existing file's hash against specified source_hash: %s", + err, + exc_info_on_loglevel=logging.DEBUG, + ) + else: + if source_sum and source_sum["hsum"] == hsum: + replace = False + if not replace and os.path.exists(name): ret_perms = {} # Check and set the permissions if necessary diff --git a/tests/pytests/functional/states/file/test_managed.py b/tests/pytests/functional/states/file/test_managed.py index 4a12ef163a19..04c5b9d57b90 100644 --- a/tests/pytests/functional/states/file/test_managed.py +++ b/tests/pytests/functional/states/file/test_managed.py @@ -1057,7 +1057,7 @@ def test_file_managed_remote_source_does_not_refetch_existing_file_with_correct_ Issue #64373 """ name = tmp_path / "scene33" - name.write_text(grail_scene33_file.read_text()) + name.write_bytes(grail_scene33_file.read_bytes()) ret = file.managed( str(name), source="http://127.0.0.1:1337/does/not/exist",