Skip to content

Commit

Permalink
Use build deps matrix for ci deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Nov 20, 2024
1 parent 08a4b09 commit 15128cf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 288 deletions.
51 changes: 7 additions & 44 deletions .github/workflows/build-deps-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ on:
required: true
type: string
description: Nox Tarball Cache Hash
kind:
required: true
type: string
description: Kind of dependencies to build; linux, macos, windows
python-version:
required: false
type: string
Expand All @@ -38,6 +34,10 @@ on:
type: string
description: The onedir package name to use
default: salt
matrix:
required: true
type: string
description: Json job matrix config


env:
Expand All @@ -52,52 +52,17 @@ env:

jobs:

generate-matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
env:
PIP_INDEX_URL: https://pypi.org/simple
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: "Throttle Builds"
shell: bash
run: |
t=$(shuf -i 1-30 -n 1); echo "Sleeping $t seconds"; sleep "$t"
- name: Checkout Source Code
uses: actions/checkout@v4

- name: Setup Python Tools Scripts
uses: ./.github/actions/setup-python-tools-scripts
with:
cache-prefix: ${{ inputs.cache-prefix }}
env:
PIP_INDEX_URL: https://pypi.org/simple

- name: Generate Test Matrix
id: generate-matrix
run: |
tools ci deps-matrix
linux-dependencies:
name: Linux
needs:
- generate-matrix
runs-on:
- ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || 'linux-arm64' }}
if: ${{ inputs.kind == 'linux' }}
env:
USE_S3_CACHE: 'false'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include)['linux'] }}
include: ${{ fromJSON(inputs.matrix)['linux'] }}
steps:
- uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -183,12 +148,11 @@ jobs:
needs:
- generate-matrix
runs-on: ${{ matrix.distro-slug }}
if: ${{ inputs.kind == 'macos' }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include)['macos'] }}
include: ${{ fromJSON(inputs.matrix)['macos'] }}
env:
PIP_INDEX_URL: https://pypi.org/simple
steps:
Expand Down Expand Up @@ -273,15 +237,14 @@ jobs:
- generate-matrix
name: Windows
runs-on: windows-latest
if: ${{ inputs.kind == 'windows' }}
env:
USE_S3_CACHE: 'false'
GITHUB_WORKSPACE: 'C:\Windows\Temp\testing'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include)['windows'] }}
include: ${{ fromJSON(inputs.matrix)['windows'] }}
steps:

- name: "Throttle Builds"
Expand Down
45 changes: 4 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,40 +445,7 @@ jobs:
relenv-version: "0.18.0"
python-version: "3.10.15"
source: "onedir"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
build-ci-deps-linux:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: linux

build-ci-deps-macos:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: macos

build-ci-deps-windows:
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }} build-ci-deps:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
Expand All @@ -492,7 +459,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: windows
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}

test-pkg-rockylinux-8:
name: Rocky Linux 8 Package Test
Expand Down Expand Up @@ -1978,9 +1945,7 @@ jobs:
PIP_INDEX_URL: https://pypi.org/simple
needs:
- prepare-workflow
- build-ci-deps-linux
- build-ci-deps-macos
- build-ci-deps-windows
- build-ci-deps
- test-windows-2019
- test-windows-2022
- test-macos-12
Expand Down Expand Up @@ -2149,9 +2114,7 @@ jobs:
- build-deps-onedir
- build-salt-onedir
- combine-all-code-coverage
- build-ci-deps-linux
- build-ci-deps-macos
- build-ci-deps-windows
- build-ci-deps
- test-windows-2019
- test-windows-2022
- test-macos-12
Expand Down
41 changes: 3 additions & 38 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,7 @@ jobs:
environment: nightly
sign-macos-packages: false
sign-windows-packages: false
secrets: inherit
build-ci-deps-linux:
secrets: inherit build-ci-deps:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
Expand All @@ -537,39 +536,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: linux

build-ci-deps-macos:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: macos

build-ci-deps-windows:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: windows
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}

test-pkg-rockylinux-8:
name: Rocky Linux 8 Package Test
Expand Down Expand Up @@ -2788,9 +2755,7 @@ jobs:
- build-windows-repo
- build-macos-repo
- build-onedir-repo
- build-ci-deps-linux
- build-ci-deps-macos
- build-ci-deps-windows
- build-ci-deps
- test-windows-2019
- test-windows-2022
- test-macos-12
Expand Down
39 changes: 3 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,38 +168,7 @@ jobs:
name: salt-${{ inputs.salt-version }}-onedir-${{ matrix.platform }}-${{ matrix.arch }}.tar.xz
path: artifacts/salt-${{ inputs.salt-version }}-onedir-${{ matrix.platform }}-${{ matrix.arch }}.tar.xz*
retention-days: 7
if-no-files-found: error
build-ci-deps-linux:
name: CI Deps
needs:
- prepare-workflow
- download-onedir-artifact
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: linux

build-ci-deps-macos:
name: CI Deps
needs:
- prepare-workflow
- download-onedir-artifact
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: macos

build-ci-deps-windows:
if-no-files-found: error build-ci-deps:
name: CI Deps
needs:
- prepare-workflow
Expand All @@ -212,7 +181,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: windows
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}

backup:
name: Backup
Expand Down Expand Up @@ -478,9 +447,7 @@ jobs:
- pkg-download-tests
- release
- publish-pypi
- build-ci-deps-linux
- build-ci-deps-macos
- build-ci-deps-windows
- build-ci-deps
steps:
- name: Get workflow information
id: get-workflow-info
Expand Down
41 changes: 3 additions & 38 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ jobs:
relenv-version: "0.18.0"
python-version: "3.10.15"
source: "onedir"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
build-ci-deps-linux:
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }} build-ci-deps:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
Expand All @@ -499,39 +498,7 @@ jobs:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: linux

build-ci-deps-macos:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: macos

build-ci-deps-windows:
name: CI Deps
if: ${{ fromJSON(needs.prepare-workflow.outputs.jobs)['build-deps-ci'] }}
needs:
- prepare-workflow
- build-salt-onedir
uses: ./.github/workflows/build-deps-ci-action.yml
with:
nox-session: ci-test-onedir
nox-version: 2022.8.7
python-version: "3.10"
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.15
nox-archive-hash: "${{ needs.prepare-workflow.outputs.nox-archive-hash }}"
kind: windows
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}

test-pkg-rockylinux-8:
name: Rocky Linux 8 Package Test
Expand Down Expand Up @@ -2025,9 +1992,7 @@ jobs:
- build-docs
- build-deps-onedir
- build-salt-onedir
- build-ci-deps-linux
- build-ci-deps-macos
- build-ci-deps-windows
- build-ci-deps
- test-windows-2019
- test-windows-2022
- test-macos-12
Expand Down
Loading

0 comments on commit 15128cf

Please sign in to comment.