diff options
Diffstat (limited to '.github/workflows/self_host_build.yml')
| -rw-r--r-- | .github/workflows/self_host_build.yml | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/.github/workflows/self_host_build.yml b/.github/workflows/self_host_build.yml new file mode 100644 index 000000000..2645f9738 --- /dev/null +++ b/.github/workflows/self_host_build.yml @@ -0,0 +1,134 @@ +name: Validate Build + +on: + pull_request: + types: [opened, reopened] + branches: [ main ] + +jobs: + clang-format: + name: Check clang-format + runs-on: [self-hosted, linux, x64] + strategy: + matrix: + path: + - 'zen' + - 'zencore' + - 'zencore-test' + - 'zenhttp' + - 'zenserver-test' + - 'zenstore' + - 'zenstore-test' + - 'zentest-appstub' + - 'zenutil' + - 'zenserver' + steps: + - uses: actions/checkout@v2 + - name: clang-format ${{ matrix.path }} + uses: jidicula/[email protected] + with: + clang-format-version: '13' + check-path: ${{ matrix.path }} + + windows-build: + name: Build Windows + needs: clang-format + runs-on: [self-hosted, windows, x64] + 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 & Test + run: | + xmake test -v -y + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg + + linux-build: + name: Build Linux + needs: clang-format + runs-on: [self-hosted, linux, x64] + strategy: + matrix: + config: + - 'debug' + - 'release' + arch: + - 'x86_64' + env: + VCPKG_VERSION: 2022.03.10 + + steps: + - uses: actions/checkout@v2 + + - name: Set up GCC 11 + uses: egor-tensin/setup-gcc@v1 + with: + version: 11 + platform: x64 + + - 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.sh + 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 & Test + run: | + xmake test -v -y + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg |