From e23a43dc9c590fb69fa772e4225543a6d500d79c Mon Sep 17 00:00:00 2001 From: Alex Dunn Date: Mon, 4 Apr 2022 11:38:12 -0700 Subject: Testing just windows self-hosted runner using on-prem test box --- .github/workflows/on_prem_windows.yml | 112 ++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/on_prem_windows.yml (limited to '.github/workflows') diff --git a/.github/workflows/on_prem_windows.yml b/.github/workflows/on_prem_windows.yml new file mode 100644 index 000000000..1aef1404b --- /dev/null +++ b/.github/workflows/on_prem_windows.yml @@ -0,0 +1,112 @@ +name: Validate + +on: + push: + branches: + - main + pull_request: + branches: [ main ] + +jobs: + windows-build: + name: Build Windows + runs-on: self-hosted + strategy: + matrix: + config: + - 'debug' + - 'release' + arch: + - 'x64' + env: + VCPKG_VERSION: 2022.03.10 + + steps: + - uses: actions/checkout@v2 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: 2.6.4 + + - name: Installing vcpkg + run: | + git clone -b ${{env.VCPKG_VERSION}} --single-branch https://github.com/Microsoft/vcpkg.git .vcpkg + cd .vcpkg + .\bootstrap-vcpkg.bat + .\vcpkg.exe integrate install + cd .. + + - name: Cache vcpkg + uses: actions/cache@v2 + with: + path: | + ${{ github.workspace }}\.vcpkg\installed + key: ${{ runner.os }}-${{ matrix.config }}-${{env.VCPKG_VERSION}}-${{ hashFiles('xmake.lua') }}-${{ matrix.arch }}-v5 + + - name: Config + run: | + xmake config -v -y -m ${{ matrix.config }} --arch=${{ matrix.arch }} + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg + + - name: Build + run: | + xmake build -v -y + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg + + - name: Create Archive + run: | + cd .\build\windows\${{ matrix.arch }}\${{ matrix.config }} + 7z a -r ..\..\..\..\windows-${{ matrix.arch }}-${{ matrix.config }}.zip * + cd ..\..\..\.. + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: windows-${{ matrix.arch }}-${{ matrix.config }} + path: .\windows-${{ matrix.arch }}-${{ matrix.config }}.zip + if-no-files-found: error + + windows-test: + name: Test Windows + runs-on: windows-2022 + needs: windows-build + strategy: + matrix: + config: + - 'debug' + - 'release' + arch: + - 'x64' + test: + - zencore-test + - zenserver + - zenserver-test + - zenstore-test + include: + - test: "zenserver" + args: "test" + - test: "zenserver-test" + args: "--test-case-exclude=websocket.basic" + + steps: + - if: ${{ matrix.test == 'zenserver-test' }} + uses: actions/checkout@v2 + + - name: Download + uses: actions/download-artifact@v3 + with: + name: windows-${{ matrix.arch }}-${{ matrix.config }} + + - name: Extract Archive + run: | + mkdir -p .\build\windows\${{ matrix.arch }}\${{ matrix.config }} + cd .\build\windows\${{ matrix.arch }}\${{ matrix.config }} + 7z x ..\..\..\..\windows-${{ matrix.arch }}-${{ matrix.config }}.zip + cd ..\..\..\.. + + - name: Test ${{matrix.test}} + run: | + .\build\windows\${{ matrix.arch }}\${{ matrix.config }}\${{ matrix.test }}.exe ${{ matrix.args }} -- cgit v1.2.3