Rework build and testing for Linux and Windows #32
Workflow file for this run
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
| name: Build binaries | |
| on: [push, pull_request] | |
| jobs: | |
| linux-x64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Configure build system | |
| run: | | |
| time wget -q "https://github.com/Terraspace/UASM/releases/download/v2.57r/uasm257_linux64.zip" | |
| unzip uasm257_linux64.zip uasm | |
| sudo install -m 755 uasm /usr/bin | |
| - name: Build | |
| run: | | |
| cd ~/work/7-Zip-zstd/7-Zip-zstd/CPP | |
| ./build-lx.sh | |
| - name: Test | |
| run: | | |
| cd ~/work/7-Zip-zstd/7-Zip-zstd/tests | |
| ./test-lx.sh | |
| linux-arm64: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build | |
| run: | | |
| cd ~/work/7-Zip-zstd/7-Zip-zstd/CPP | |
| ./build-lx.sh | |
| - name: Test | |
| run: | | |
| cd ~/work/7-Zip-zstd/7-Zip-zstd/tests | |
| ./test-lx.sh | |
| ######################################################################################## | |
| # overview for supported targets: | |
| # 12.0 https://learn.microsoft.com/en-us/visualstudio/releases/2013/vs2013-compatibility-vs | |
| # 14.0 https://learn.microsoft.com/en-us/visualstudio/releases/2015/vs2015-compatibility-vs | |
| # 15.0 https://learn.microsoft.com/en-us/visualstudio/releases/2017/vs2017-compatibility-vs | |
| # 16.0 https://learn.microsoft.com/en-us/visualstudio/releases/2019/compatibility | |
| # 17.0 https://learn.microsoft.com/en-us/visualstudio/releases/2022/compatibility | |
| # -> we take 16.0 for now /TR | |
| ######################################################################################## | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| arch: [ amd64, amd64_x86, amd64_arm64 ] | |
| darkmode: [darkmode, ''] | |
| include: | |
| - arch: amd64_x86 | |
| subsys: "5.01" | |
| platform: "x86" | |
| - arch: amd64 | |
| subsys: "5.02" | |
| platform: "x64" | |
| - arch: amd64_arm64 | |
| subsys: "6.02" | |
| platform: "arm64" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Add msbuild to PATH | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Enable Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1.13.0 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Pre-requirements | |
| shell: cmd | |
| run: | | |
| @if "${{matrix.darkmode}}" == "darkmode" ( | |
| @if exist DarkMode\lib\src ( | |
| @echo use DarkMode/lib | |
| ) else ( | |
| @echo checkout darkmodelib module ... | |
| git submodule update --init --recursive DarkMode/lib | |
| if %errorlevel% neq 0 ( | |
| @echo checkout module failed, clone ... | |
| git clone https://github.com/ozone10/darkmodelib.git DarkMode/lib | |
| ) | |
| ) | |
| ) | |
| - name: Compiling ${{ matrix.arch }} | |
| shell: cmd | |
| run: | | |
| set WDIR=%cd% | |
| set PLATFORM=${{matrix.platform}} | |
| set SUBSYS=${{matrix.subsys}} | |
| set ROOT=%cd%\CPP\7zip | |
| set OUTDIR=%WDIR%\build\bin-%PLATFORM% | |
| @if "${{matrix.darkmode}}" == "darkmode" ( | |
| if "${{matrix.subsys}}" lss "6.00" set SUBSYS=6.00 | |
| set ZIP7_DARKMODE=1 | |
| ) else ( | |
| set OUTDIR=%OUTDIR%-ndm | |
| set ZIP7_DARKMODE=0 | |
| ) | |
| set LFLAGS=/SUBSYSTEM:WINDOWS,%SUBSYS% | |
| set ERRFILE= | |
| set STOP_ON_ERROR=1 | |
| echo "********" | |
| echo "Working Dir: %WDIR%" | |
| echo "Platform: %PLATFORM%" | |
| echo "SUBSYS: %SUBSYS%" | |
| @echo off | |
| call CPP\build-it.cmd -no-init | |
| IF %errorlevel% NEQ 0 EXIT 1 | |
| REM Will be by the do-release action | |
| copy %WDIR%\.github\workflows\do-release.cmd %WDIR%\build\do-release.cmd | |
| - name: Test | |
| shell: cmd | |
| run: | | |
| set PLATFORM=${{matrix.platform}} | |
| set OUTDIR=build\bin-%PLATFORM% | |
| if "${{matrix.darkmode}}" == "" set OUTDIR=%OUTDIR%-ndm | |
| set Z7_PATH=%OUTDIR%\7z.exe | |
| tclsh tests\7z-test.tcl -verbose tpsem | |
| - name: Upload a Build Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| path: ${{ github.workspace }}\build\**\* | |
| name: binary-${{ matrix.arch }}-${{ matrix.darkmode }} | |
| do-release: | |
| runs-on: windows-latest | |
| needs: windows | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| path: artifact | |
| pattern: binary-* | |
| merge-multiple: true | |
| - name: Generate binaries for release | |
| shell: cmd | |
| run: | | |
| cd artifact | |
| do-release.cmd | |
| - uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: binary-* | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: 7-Zip ZS Release binaries | |
| path: | | |
| artifact\*.exe | |
| artifact\*.7z |