Skip to content

Commit

Permalink
Improve build system, report error when build fail finally
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 4, 2025
1 parent 01093d5 commit a6bbef5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
submodules: 'recursive'
- name: Build
shell: pwsh
run: .\tools\cmdline\axmol -p win32 -a x64 ; .\tools\cmdline\axmol run -p win32 -a x64 -xb '--target,unit-tests'
run: .\tools\cmdline\axmol -p win32 -a x64 && .\tools\cmdline\axmol run -p win32 -a x64 -t unit-tests
- uses: actions/upload-artifact@v4
with:
name: windows_x64
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Build
shell: pwsh
run: ./tools/cmdline/axmol -p linux -a x64 ; ./tools/cmdline/axmol -p linux -a x64 -xb '--target,lua-tests' ; ./tools/cmdline/axmol run -p linux -a x64 -xb '--target,unit-tests' -wait
run: ./tools/cmdline/axmol -p linux -a x64 -t 'cpp-tests,lua-tests' && ./tools/cmdline/axmol run -p linux -a x64 -xb -t unit-tests -wait
osx-arm64:
runs-on: macos-latest
steps:
Expand All @@ -85,7 +85,7 @@ jobs:
submodules: 'recursive'
- name: Build
shell: pwsh
run: ./tools/cmdline/axmol -p osx ; ./tools/cmdline/axmol run -p osx -xb '--target,unit-tests'
run: ./tools/cmdline/axmol -p osx && ./tools/cmdline/axmol run -p osx -t unit-tests
osx-x64:
runs-on: macos-13
steps:
Expand All @@ -94,7 +94,7 @@ jobs:
submodules: 'recursive'
- name: Build
shell: pwsh
run: ./tools/cmdline/axmol -p osx ; ./tools/cmdline/axmol run -p osx -xb '--target,unit-tests'
run: ./tools/cmdline/axmol -p osx && ./tools/cmdline/axmol run -p osx -t unit-tests
android:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -145,11 +145,7 @@ jobs:
submodules: 'recursive'
- name: Build
shell: pwsh
run: |
./tools/cmdline/axmol -p wasm -xc '-DAX_ENABLE_EXT_EFFEKSEER=ON,-DAX_WASM_THREADS=8' -j2
echo "ErrorActionPreference=$ErrorActionPreference"
./tools/cmdline/axmol -p wasm -xc '-DAX_ENABLE_EXT_EFFEKSEER=ON,-DAX_WASM_THREADS=8' -j2 -xb '--target,fairygui-tests'
./tools/cmdline/axmol -p wasm -xc '-DAX_ENABLE_EXT_EFFEKSEER=ON,-DAX_WASM_THREADS=8' -j2 -xb '--target,lua-tests'
run: ./tools/cmdline/axmol -p wasm -xc '-DAX_ENABLE_EXT_EFFEKSEER=ON,-DAX_WASM_THREADS=8' -j2 -t 'cpp-tests,fairygui-tests,lua-tests'
- uses: actions/upload-artifact@v4
with:
name: wasm
Expand Down
2 changes: 2 additions & 0 deletions tools/cmdline/axmol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,5 @@ if ($args[0] -eq 'new') {
}

. $plugin.proc @sub_args @sub_opts

exit $LASTEXITCODE
17 changes: 7 additions & 10 deletions tools/cmdline/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,11 @@ if ($forceConfig) {
}

. $1k_script @1k_args @forward_args @unhandled_args

if (!$configOnly) {
if ($?) {
$1k.pause('Build success')
} else {
throw "Build fail, ret=$LASTEXITCODE"
}
}
else {
$1k.pause('Generate done')
$op_name = @('Generate', 'Build')[!$configOnly]
if ($?) {
$1k.pause("$op_name success")
} else {
Write-Error "$op_name fail, ret=$LASTEXITCODE"
}

exit $LASTEXITCODE

0 comments on commit a6bbef5

Please sign in to comment.