diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-25 20:07:57 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-06-02 00:35:51 +0200 |
| commit | f3ff618c4dc8041f952816264cb785ad39cb3910 (patch) | |
| tree | 5428dd71df28e6d122477d69b53a71f7bea466c7 /.github/workflows/validate.yml | |
| parent | bundle if we are on main branch (diff) | |
| download | zen-f3ff618c4dc8041f952816264cb785ad39cb3910.tar.xz zen-f3ff618c4dc8041f952816264cb785ad39cb3910.zip | |
use tagging as trigger for creating release
Diffstat (limited to '.github/workflows/validate.yml')
| -rw-r--r-- | .github/workflows/validate.yml | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 000000000..933fcd321 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,152 @@ +name: Validate + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: [ main ] + +jobs: + clang-format: + name: Check clang-format + runs-on: [self-hosted, linux, x64] + + steps: + - uses: actions/checkout@v2 + + - name: clang-format + uses: jidicula/[email protected] + with: + clang-format-version: '13' + check-path: '.' + exclude-regex: (.*thirdparty.*) + + windows-build: + name: Build & Test Windows + runs-on: [self-hosted, windows, x64] + timeout-minutes: 10 + 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: Bundle + if: ${{ github.ref_name == 'main') + run: | + xmake bundle -v -y + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg + + - name: upload zenserver-linux + if: ${{ github.ref_name == 'main') + uses: actions/upload-artifact@v3 + with: + name: zenserver-linux + path: build/zenserver-linux.zip + + - 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 & Test Linux + runs-on: [self-hosted, linux, x64] + timeout-minutes: 10 + 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: Bundle + if: ${{ github.ref_name == 'main') + run: | + xmake bundle -v -y + env: + VCPKG_ROOT: ${{ github.workspace }}/.vcpkg + + - name: upload zenserver-win64 + if: ${{ github.ref_name == 'main') + uses: actions/upload-artifact@v3 + with: + name: zenserver-win64 + path: build/zenserver-win64.zip + + - 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 |