Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3006.x] Migrate workflows off AWS #67005

Merged
merged 225 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
4c612e5
Add some gh runners
dwoz Oct 28, 2024
5ce0922
Add runners to linter and disbale cache for salt onedir builds
dwoz Oct 28, 2024
8ff31a1
Migrate build-deps-onedir step to gh runners
dwoz Oct 28, 2024
30acc6d
Do not cache relenv for now
dwoz Oct 28, 2024
a51a9f0
Disable more caches
dwoz Oct 28, 2024
2683203
Update constraints for python 3.12
dwoz Oct 28, 2024
d7c8d9c
Fix download location
dwoz Oct 29, 2024
2b3041e
Set use s3 cache env to false
dwoz Oct 29, 2024
a101dc8
Build packages on gh runners
dwoz Oct 29, 2024
7b635d1
Migrate build deps ci action
dwoz Oct 29, 2024
da4c73d
Add test-action-linux-ng.yml
dwoz Oct 29, 2024
83dbb38
Fix workflow name
dwoz Oct 29, 2024
971236d
Change template not generated files
dwoz Oct 29, 2024
52b5b96
Disable s3 cache for build deps ci
dwoz Oct 29, 2024
9ffb506
Do not use tools vm for deps ci action
dwoz Oct 29, 2024
11a5b6b
wean of aws bits
dwoz Oct 29, 2024
d2690ed
Setup python
dwoz Oct 30, 2024
0ed0370
Migrate windows to gh runners
dwoz Oct 30, 2024
46d92b1
be more specific with python version
dwoz Oct 30, 2024
caf5f57
check python binary
dwoz Oct 30, 2024
ba0e47c
no container
dwoz Oct 30, 2024
36fb0c2
revert cache change
dwoz Oct 30, 2024
298553b
Disable more s3 caching
dwoz Oct 30, 2024
ee592c0
Do not install any system dependencies yet
dwoz Oct 30, 2024
9346246
Do not build 'source' packages for PRs
dwoz Oct 30, 2024
6da4f09
Fix nox tarball name
dwoz Oct 30, 2024
1350ae9
Build windows deps on github runner
dwoz Oct 30, 2024
004bfee
Fix decompress step
dwoz Oct 31, 2024
4255872
Fix decompress nox step on windows
dwoz Oct 31, 2024
16897ec
fetch correct nox tarball
dwoz Oct 31, 2024
11f101a
bump relenv version
dwoz Oct 31, 2024
b302424
Download from alt location
dwoz Oct 31, 2024
111ef16
Update download location
dwoz Oct 31, 2024
6f1a5a3
Disable most of linux and all of mac
dwoz Nov 1, 2024
72af084
Disable more OSes for package tests
dwoz Nov 1, 2024
2d5a782
use newer container for nwo
dwoz Nov 1, 2024
53cb616
No longer use sudo
dwoz Nov 2, 2024
088e3b7
Less macos
dwoz Nov 2, 2024
e01318d
Less macos
dwoz Nov 2, 2024
80cd9ca
Fix up windows package test action
dwoz Nov 2, 2024
08ed938
Show sys info fix
dwoz Nov 2, 2024
dae1a7d
Meh
dwoz Nov 2, 2024
467e616
meh
dwoz Nov 2, 2024
38b234b
Skip reqs
dwoz Nov 2, 2024
bbc8d51
No sudo for linux pkg tests
dwoz Nov 2, 2024
1e0dfdb
Attempt systemctl mock
dwoz Nov 2, 2024
c764afc
Revert xlarge removal
dwoz Nov 2, 2024
669a157
Try macos-13-arm64 instead of xlarge
dwoz Nov 2, 2024
532ba67
Stop using xlarge runners
dwoz Nov 2, 2024
46d34a9
Mac arm is always xlarge
dwoz Nov 2, 2024
f029310
Use macos-14 for arm
dwoz Nov 2, 2024
1d32e5e
Use 3 core mac-14 for arm64
dwoz Nov 2, 2024
d7903d8
Try renaming salt dir
dwoz Nov 2, 2024
184346f
Fix package testing on windows
dwoz Nov 3, 2024
aa9534f
Fix extract location
dwoz Nov 4, 2024
90c4fa3
Upload pkg log artifacts
dwoz Nov 5, 2024
4a17911
Add rockylinux containers
dwoz Nov 5, 2024
4bf9cce
Use distro slug for windows packages
dwoz Nov 5, 2024
e80a43d
bump cache seed
dwoz Nov 6, 2024
6589368
Use rocky linux 8 too
dwoz Nov 6, 2024
459c253
More testing containers
dwoz Nov 6, 2024
2abe0d1
fix photon container name
dwoz Nov 6, 2024
ba0daa1
Enable more containers for pkg tests
dwoz Nov 6, 2024
d4d2d87
Test systemctl
dwoz Nov 6, 2024
b7e1569
Fix typo
dwoz Nov 6, 2024
503e301
Stop using deprecated save-always
dwoz Nov 6, 2024
bea3455
Try systemd containers
dwoz Nov 8, 2024
b34f273
More package tests
dwoz Nov 8, 2024
670aa70
Skip downgrade tests on windows
dwoz Nov 8, 2024
899e9d8
Do not mount volumes
dwoz Nov 8, 2024
2947ac1
debug pkg install
dwoz Nov 8, 2024
36fe98c
Systemd container rename
dwoz Nov 8, 2024
9b9ad50
Wean off linux-x86_64 runner
dwoz Nov 9, 2024
e6deffb
Fix self hosted vs github hosted
dwoz Nov 9, 2024
7d654dd
Add build-matrix
dwoz Nov 9, 2024
7a90b83
reduce mandatory
dwoz Nov 9, 2024
f36e56f
remove some debugging
dwoz Nov 9, 2024
8213a2d
Run ubunut pkg tests on 22.04
dwoz Nov 9, 2024
498f243
meh
dwoz Nov 9, 2024
545e752
use testing container for pre-commit
dwoz Nov 9, 2024
c5ea8e6
Skip arm64 packages tests when no arm runner configured
dwoz Nov 9, 2024
71a9844
Do not run arm but run x86 always
dwoz Nov 10, 2024
b4f336e
Fix runner check
dwoz Nov 10, 2024
bd82c55
Add config workflow step
dwoz Nov 10, 2024
fcc0763
allow break system packges
dwoz Nov 10, 2024
ad06b5f
meh
dwoz Nov 10, 2024
597242b
meh
dwoz Nov 10, 2024
26986a5
expand on job names
dwoz Nov 10, 2024
96de7c9
Fix windows test action tests
dwoz Nov 10, 2024
b01fc35
meh
dwoz Nov 10, 2024
2007e3c
pkg matrix fix for arm
dwoz Nov 10, 2024
c41f9d0
Try overriding entrypoint
dwoz Nov 10, 2024
c925479
Fix matrix again
dwoz Nov 10, 2024
4b86400
Fix parameter name
dwoz Nov 10, 2024
8a9c63f
disable jobs
dwoz Nov 10, 2024
4e7469a
Add config step to prepare workflow
dwoz Nov 10, 2024
de5d0bf
meh
dwoz Nov 10, 2024
8427624
fix linux test runner name
dwoz Nov 10, 2024
aebf78f
Do not use setup-python action on containres
dwoz Nov 10, 2024
4749d11
Migrate tests to use packages.broadcom.com instead of repo.saltprojec…
dwoz Nov 10, 2024
56f0a49
Do not use setup-python action in container
dwoz Nov 11, 2024
33f82c9
Fix pkg step name for linux
dwoz Nov 11, 2024
faa0b5d
Need to work out mandatory OSes and defined jobs
dwoz Nov 11, 2024
a36644f
Only use free mac runners
dwoz Nov 11, 2024
fea3937
Test debug
dwoz Nov 12, 2024
3be3ce4
Migrate more jobs to config
dwoz Nov 12, 2024
b5e7b0d
re-enable mac
dwoz Nov 12, 2024
8d631fc
Fix pre-commit
dwoz Nov 18, 2024
03bf713
More systemd
dwoz Nov 18, 2024
8c44ab1
Add macos arm onedir deps
dwoz Nov 18, 2024
0221347
Drop os-labels and pull-labels
dwoz Nov 18, 2024
ad87992
Fix up mac build logic
dwoz Nov 19, 2024
05a70fd
Fix build salt logic for mac
dwoz Nov 19, 2024
b2983c1
Fix pre-commit
dwoz Nov 19, 2024
9bdc295
Fix undefined variable on mac
dwoz Nov 19, 2024
c0d96f0
Do not clear macos matrix for pkg tests
dwoz Nov 19, 2024
61d2686
Fix pre-commit
dwoz Nov 20, 2024
8bde678
More places disabling mac
dwoz Nov 20, 2024
bef8ead
use build deps matrix from config
dwoz Nov 20, 2024
d2f082d
Use build-matrix for salt onedir
dwoz Nov 20, 2024
8dead11
Use build matrix for packages
dwoz Nov 20, 2024
d23fde8
Remove un-needed build-matrix command
dwoz Nov 20, 2024
6ebed6d
Use build deps matrix for ci deps
dwoz Nov 20, 2024
0217b69
Remove unused job names
dwoz Nov 20, 2024
cda795a
Remove source from build package matrix
dwoz Nov 20, 2024
5646183
Fix ci deps for macos arches
dwoz Nov 20, 2024
2fdc340
fix linter
dwoz Nov 20, 2024
5793691
Add arguments needed for pkg matrix on workflow config
dwoz Nov 20, 2024
c515b47
Fix pre-commit
dwoz Nov 21, 2024
af167a9
Fix up prepare release step
dwoz Nov 21, 2024
e6e7676
Fix actionlint
dwoz Nov 21, 2024
65cf986
Warn about range library
dwoz Nov 21, 2024
e5af363
log string versions
dwoz Nov 21, 2024
0a990cd
Log pkg matrix
dwoz Nov 21, 2024
94cc6bf
package build matrix wip
dwoz Nov 22, 2024
17ddf39
Add mac and windows
dwoz Nov 22, 2024
3bbffc8
Run build repo on ubuntu-latest
dwoz Nov 22, 2024
4c1bd41
Comment out package test enumeration
dwoz Nov 22, 2024
77fb045
Log github event
dwoz Nov 22, 2024
7ec4852
Fix pkg step names
dwoz Nov 22, 2024
d288748
No longer build and publish repositories
dwoz Nov 23, 2024
4dba087
Fix staging workflow
dwoz Nov 23, 2024
f183081
Filter arm when needed
dwoz Nov 23, 2024
3c9c4d0
Fix issues in pre-commit
dwoz Nov 23, 2024
022620d
Fix up packages action
dwoz Nov 23, 2024
8d024a4
Use test matrix
dwoz Nov 25, 2024
b830a64
Remove unwanted needs
dwoz Nov 25, 2024
845af34
Workflow fix
dwoz Nov 26, 2024
64db1c7
Fix action name for package tests
dwoz Nov 26, 2024
d0be4eb
Fix matrix names
dwoz Nov 26, 2024
77940da
Add mac and windows to tests action
dwoz Nov 27, 2024
ea8af18
Clean up un-used actions
dwoz Nov 27, 2024
409afde
Wrap json in single quotes
dwoz Nov 27, 2024
bd0fb34
Fix slug param name
dwoz Nov 27, 2024
515d674
Skip upload release artifacts to bucket
dwoz Dec 3, 2024
69f18a3
Fix windows mac test matrix
dwoz Dec 3, 2024
3a9e0df
Fix pacakge name on mac and windows
dwoz Dec 4, 2024
59827f6
Do not try to download repo
dwoz Dec 4, 2024
eeeb8f0
Do not upload tarball
dwoz Dec 4, 2024
26e7644
We no longer need to extend job names
dwoz Dec 4, 2024
5ec5a88
Pr is not defined
dwoz Dec 4, 2024
b29d71e
Fix label search when no pr defined
dwoz Dec 4, 2024
cca6e71
Skip workflows that do not have matrix
dwoz Dec 4, 2024
af379d2
Fix empty list check
dwoz Dec 4, 2024
a0bea5d
Remove un-used build-repos step
dwoz Dec 4, 2024
bd87cf4
Use ubuntu-22.04 in place of ubuntu-latest
dwoz Dec 4, 2024
8d7ffd4
Try to fix docs lint
dwoz Dec 4, 2024
887395f
Clean up test and test-pkg templates
dwoz Dec 4, 2024
5a8aba4
Skip lintcheck to test build
dwoz Dec 4, 2024
4734877
Skip docs spellcheck for testing purposes
dwoz Dec 5, 2024
ca2bcce
Test docker creation
dwoz Dec 5, 2024
43e4bba
Add back setup python step
dwoz Dec 5, 2024
bb419f9
Fix docker exec
dwoz Dec 5, 2024
f70df51
Try matrix without include
dwoz Dec 5, 2024
250c908
Fix empty martix
dwoz Dec 5, 2024
71645a5
Start created container
dwoz Dec 6, 2024
293300c
test empty matrix
dwoz Dec 6, 2024
0f81932
Fix matrix
dwoz Dec 6, 2024
1c16351
fix pre-commit
dwoz Dec 6, 2024
e119757
meh
dwoz Dec 6, 2024
fc5bd71
meh
dwoz Dec 6, 2024
2df002a
Fix condition check
dwoz Dec 6, 2024
53342da
Re-enable matrix
dwoz Dec 6, 2024
4ae24a8
Do not sepcify network for container
dwoz Dec 6, 2024
456faec
Clean up workflows
dwoz Dec 6, 2024
330214b
Include matrix without include keyword
dwoz Dec 6, 2024
21b204e
Filter out some test runs
dwoz Dec 6, 2024
3b6aa9c
Re-use include for matrix
dwoz Dec 6, 2024
58039da
Add draft release step to staging
dwoz Dec 7, 2024
71d2259
Use normal test containers
dwoz Dec 7, 2024
d6a12f2
Use nox to extract tarball on container
dwoz Dec 7, 2024
0ce96ea
Fix typo
dwoz Dec 7, 2024
d87bed3
support for older venv
dwoz Dec 7, 2024
12debcd
Call nox via module name
dwoz Dec 7, 2024
6522fad
Use different container names for pkg tests
dwoz Dec 7, 2024
a7e4ce1
Fix systemd path
dwoz Dec 7, 2024
c67f1b3
Fix container name
dwoz Dec 7, 2024
fd05d12
Fix workflow option name
dwoz Dec 7, 2024
2a1f8e5
Fix action input name
dwoz Dec 7, 2024
7e8d2c2
Do not use container config
dwoz Dec 7, 2024
264703b
No longer use any systemd specific containers
dwoz Dec 8, 2024
e2b8162
mac and windows have static package type
dwoz Dec 8, 2024
c83d519
Attempt to fix logs artifact name
dwoz Dec 8, 2024
ae15d56
Fix prepare workflow step
dwoz Dec 8, 2024
2c3f867
Download all artifacts to artifacts/ dir
dwoz Dec 8, 2024
718d66d
Fix artifact name slug
dwoz Dec 8, 2024
6f724c6
Echo url
dwoz Dec 8, 2024
d6a6c37
Fix test environment variables
dwoz Dec 8, 2024
c95b7b5
Fix linter issues
dwoz Dec 9, 2024
00c0cfb
fix pre-commit
dwoz Dec 9, 2024
cd2866c
Fix pkg type for windows pacakge tests
dwoz Dec 9, 2024
bdfc5d0
Draft release needs packages built
dwoz Dec 9, 2024
dc445c1
Add perms to draft release
dwoz Dec 10, 2024
c5b3904
drat release also requires tests
dwoz Dec 10, 2024
bb77a3e
Run draft release when tests are skipped
dwoz Dec 12, 2024
08501c9
Require more needs results
dwoz Dec 12, 2024
294af90
Fix list files step name
dwoz Dec 12, 2024
5143c87
Try and fix draft
dwoz Dec 12, 2024
d639621
Add release name to draft
dwoz Dec 13, 2024
9949112
Experiment with output matrix
dwoz Dec 15, 2024
8ee9285
Clean up type annontations
dwoz Dec 16, 2024
c051224
Upload onedir artifacts to release
dwoz Dec 16, 2024
ffef079
Disable concurrency restricionts for now
dwoz Dec 16, 2024
c22cd41
Upload more artifacts
dwoz Dec 16, 2024
2f3f794
Fix up workflow step names
dwoz Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
self-hosted-runner:
# Labels of self-hosted runner in array of string
labels:
- bastion
- x86_64
- arm64
- aarch64
- amd64
- repo-nightly
- repo-staging
- repo-release
- medium
- large
- macos-13-xlarge
- linux-x86_64
- linux-arm64
7 changes: 0 additions & 7 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ inputs:
description: 'Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache'
default: 'false'
required: false
save-always:
description: 'Run the post step to save the cache even if another step before fails'
default: 'false'
required: false

outputs:
cache-hit:
Expand All @@ -49,7 +45,6 @@ runs:
echo "GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE=${{ inputs.enableCrossOsArchive }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_FAIL_ON_CACHE_MISS=${{ inputs.fail-on-cache-miss }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_LOOKUP_ONLY=${{ inputs.lookup-only }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_SAVE_ALWAYS=${{ inputs.save-always }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_RESTORE_KEYS=${{ inputs.restore-keys }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_UPLOAD_CHUNK_SIZE=${{ inputs.upload-chunk-size }}" | tee -a "${GITHUB_ENV}"

Expand All @@ -63,7 +58,6 @@ runs:
enableCrossOsArchive: ${{ env.GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE }}
fail-on-cache-miss: ${{ env.GHA_CACHE_FAIL_ON_CACHE_MISS }}
lookup-only: ${{ env.GHA_CACHE_LOOKUP_ONLY }}
save-always: ${{ env.GHA_CACHE_SAVE_ALWAYS }}
restore-keys: ${{ env.GHA_CACHE_RESTORE_KEYS }}
upload-chunk-size: ${{ env.GHA_CACHE_UPLOAD_CHUNK_SIZE }}

Expand Down Expand Up @@ -97,7 +91,6 @@ runs:
enableCrossOsArchive: ${{ env.GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE }}
fail-on-cache-miss: ${{ env.GHA_CACHE_FAIL_ON_CACHE_MISS }}
lookup-only: ${{ env.GHA_CACHE_LOOKUP_ONLY }}
save-always: ${{ env.GHA_CACHE_SAVE_ALWAYS }}
restore-keys: ${{ env.GHA_CACHE_RESTORE_KEYS }}
upload-chunk-size: ${{ env.GHA_CACHE_UPLOAD_CHUNK_SIZE }}

Expand Down
155 changes: 41 additions & 114 deletions .github/workflows/build-deps-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,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 @@ -48,54 +52,21 @@ 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:
- self-hosted
- linux
- bastion
- ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || 'linux-arm64' }}
env:
USE_S3_CACHE: 'true'
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:
python-version: '3.10'

- name: "Throttle Builds"
shell: bash
Expand Down Expand Up @@ -138,53 +109,33 @@ jobs:
with:
cache-prefix: ${{ inputs.cache-prefix }}-build-deps-ci

- name: Get Salt Project GitHub Actions Bot Environment
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")
SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment)
echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV"

- name: Start VM
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
id: spin-up-vm
run: |
tools --timestamps vm create --environment "${SPB_ENVIRONMENT}" --retries=2 ${{ matrix.distro-slug }}

- name: List Free Space
- name: Install System Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm ssh ${{ matrix.distro-slug }} -- df -h || true
echo true

- name: Upload Checkout To VM
- name: Install Nox
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm rsync ${{ matrix.distro-slug }}
python3 -m pip install 'nox==${{ inputs.nox-version }}'

- name: Install Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
env:
PRINT_TEST_SELECTION: "0"
PRINT_SYSTEM_INFO: "0"
run: |
tools --timestamps vm install-dependencies --nox-session=${{ inputs.nox-session }} ${{ matrix.distro-slug }}
nox --install-only -e ${{ inputs.nox-session }}

- name: Cleanup .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm pre-archive-cleanup ${{ matrix.distro-slug }}
nox --force-color -e "pre-archive-cleanup(pkg=False)"

- name: Compress .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm compress-dependencies ${{ matrix.distro-slug }}

- name: Download Compressed .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm download-dependencies ${{ matrix.distro-slug }}

- name: Destroy VM
if: always() && steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm destroy --no-wait ${{ matrix.distro-slug }}
nox --force-color -e compress-dependencies -- linux ${{ matrix.arch }}

- name: Upload Nox Requirements Tarball
uses: actions/upload-artifact@v4
Expand All @@ -194,14 +145,12 @@ jobs:

macos-dependencies:
name: MacOS
needs:
- generate-matrix
runs-on: ${{ matrix.distro-slug == 'macos-13-arm64' && 'macos-13-xlarge' || matrix.distro-slug }}
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-13' || 'macos-14' }}
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 @@ -280,21 +229,18 @@ jobs:
name: nox-macos-${{ matrix.arch }}-${{ inputs.nox-session }}
path: nox.macos.${{ matrix.arch }}.tar.*


windows-dependencies:
needs:
- generate-matrix
name: Windows
runs-on:
- self-hosted
- linux
- bastion
runs-on: windows-latest
env:
USE_S3_CACHE: 'true'
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 Expand Up @@ -327,64 +273,45 @@ jobs:
cd artifacts
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.tar.xz

- name: PyPi Proxy
- name: Set up Python ${{ inputs.python-version }}
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
sed -i '7s;^;--index-url=${{ vars.PIP_INDEX_URL }} --trusted-host ${{ vars.PIP_TRUSTED_HOST }} --extra-index-url=${{ vars.PIP_EXTRA_INDEX_URL }}\n;' requirements/static/ci/*/*.txt
uses: actions/setup-python@v5
with:
python-version: "${{ inputs.python-version }}"

- name: Setup Python Tools Scripts
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-python-tools-scripts
with:
cache-prefix: ${{ inputs.cache-prefix }}-build-deps-ci

- name: Get Salt Project GitHub Actions Bot Environment
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")
SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment)
echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV"

- name: Start VM
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
id: spin-up-vm
run: |
tools --timestamps vm create --environment "${SPB_ENVIRONMENT}" --retries=2 ${{ matrix.distro-slug }}

- name: List Free Space
- name: Install System Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm ssh ${{ matrix.distro-slug }} -- df -h || true
echo true

- name: Upload Checkout To VM
- name: Install Nox
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm rsync ${{ matrix.distro-slug }}
python3 -m pip install 'nox==${{ inputs.nox-version }}'

- name: Install Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
env:
PRINT_TEST_SELECTION: "0"
PRINT_SYSTEM_INFO: "0"
run: |
tools --timestamps vm install-dependencies --nox-session=${{ inputs.nox-session }} ${{ matrix.distro-slug }}
nox --install-only -e ${{ inputs.nox-session }}

- name: Cleanup .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm pre-archive-cleanup ${{ matrix.distro-slug }}
nox --force-color -e "pre-archive-cleanup(pkg=False)"

- name: Compress .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm compress-dependencies ${{ matrix.distro-slug }}

- name: Download Compressed .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm download-dependencies ${{ matrix.distro-slug }}

- name: Destroy VM
if: always() && steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm destroy --no-wait ${{ matrix.distro-slug }}
nox --force-color -e compress-dependencies -- windows ${{ matrix.arch }}

- name: Upload Nox Requirements Tarball
uses: actions/upload-artifact@v4
Expand Down
Loading
Loading