Last active
February 24, 2020 17:06
-
-
Save FeodorFitsner/ff5c34a72a42d492b900b05917c091e2 to your computer and use it in GitHub Desktop.
Windows after Linux chained build jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
environment: | |
matrix: | |
# Linux job | |
- job_name: Linux build | |
appveyor_build_worker_image: ubuntu | |
# Windows job | |
- job_name: Windows build | |
job_depends_on: Linux build | |
appveyor_build_worker_image: Visual Studio 2017 | |
matrix: | |
fast_finish: true | |
for: | |
- | |
matrix: | |
only: | |
- job_name: Linux build | |
build_script: | |
- sh: echo "Building on Linux..." | |
- sh: sleep 5 | |
test: off | |
- | |
matrix: | |
only: | |
- job_name: Windows build | |
build_script: | |
- ps: Write-Host "Building on Windows..." | |
- ps: Start-Sleep 5 | |
- ps: Write-Host "Deploying" | |
test: off |
Sure, you can use job_group
in a job definition and then use group name as a dependency:
environment:
matrix:
# Linux job
- job_name: Linux build
job_group: build
appveyor_build_worker_image: ubuntu
# Windows job
- job_name: Windows build
job_group: build
appveyor_build_worker_image: Visual Studio 2017
# Tests
- job_name: Tests
job_depends_on: build
appveyor_build_worker_image: Visual Studio 2017
matrix:
fast_finish: true
for:
-
...
This way both "Linux build" and "Windows build" jobs will be run in parallel (if account has enough concurrent jobs) and "Tests" job after them.
Hey, thanks for your reply!
Made my life easier ๐
Why is this not in the documentations yet, though?
This feature was kind of experimental, but we are definitely going to document it. Glad it worked for you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there!
Thanks for sharing this. It's about to make my life easier ๐
BTW, is it possible to wait for multiple jobs?
My current solution is to chain everything, although I hope there is something more elegant.
'Clumsy' solution: