Calling other jobs script in gitlab ci yaml

I have two jobs in my gitlab-ci.yml file. build and test. I scheduled the test_job but before test_job start build_job` should work always, so I tried :

My yaml file is this.
variables:
MSBUILD_PATH: ‘C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe’
SOLUTION_PATH: ‘Source/NewProject.sln’

stages:

  • build
  • test

build_job:
stage: build
script:
- ‘& “$env:MSBUILD_PATH” “$env:SOLUTION_PATH” /nologo /t:Rebuild /p:Configuration=Debug’
- pwd
artifacts:
paths:
- ‘Output’
except:
variables:
- $SCHEDULED_TEST == “True”

test_job:
stage: test
before_script:
- ‘& “$env:MSBUILD_PATH” “$env:SOLUTION_PATH” /nologo /t:Rebuild /p:Configuration=Debug’
script:
- ‘Output\bin\Debug\NewProject.exe’
only:
variables:
- $SCHEDULED_TEST == “True”


I wrote build job's script in test job's before script. My question is How can I call build job script in test job before script without directly write ? thank you for your all helps.