name: ownCloud CI on: push: branches: - master - '[0-9]+.*' pull_request: defaults: run: shell: pwsh jobs: # ------------------------------------------------------------------------------------------------------------------------------------------ build: name: Build ownCloud runs-on: ${{ matrix.os }} strategy: matrix: include: - target: windows-msvc2017_64-cl os: windows-latest fetch-depth: 0 - target: macos-64-clang os: macos-latest fetch-depth: 1 - target: linux-64-gcc os: ubuntu-18.04 fetch-depth: 1 env: CRAFT_TARGET: ${{ matrix.target }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} steps: - name: Check out source code uses: actions/checkout@v2 with: fetch-depth: ${{ matrix.fetch-depth }} submodules: true - name: Restore cache uses: actions/cache@v2 with: path: ~/cache key: ${{ runner.os }}-${{ matrix.target }} - name: Clone CraftMaster run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "$env:HOME/craft/CraftMaster/CraftMaster" - name: Craft setup run: | New-Item -Path ~/cache -ItemType Directory -ErrorAction SilentlyContinue ${{ github.workspace }}/.github/workflows/.craft.ps1 --setup - name: Craft unshelve run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --unshelve "${{ github.workspace }}/.craft.shelf" - name: Prepare run: | if ($IsWindows) { ${{ github.workspace }}/.github/workflows/.craft.ps1 -c dev-utils/nsis } elseif($IsLinux) { sudo apt-get update -y sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libmtdev1 libgl1-mesa-dev libmtdev1 libinput-dev libxkbcommon0 libxcb-icccm4 libxcb-image0 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 libxcb-keysyms1 libxcb-xinerama0 libsm6 ${{ github.workspace }}/.github/workflows/.craft.ps1 -c dev-utils/linuxdeploy } - name: Install dependencies run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --install-deps owncloud/owncloud-client - name: Build run: | if ("${{ matrix.target }}" -eq "windows-msvc2017_64-cl") { ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --configure owncloud/owncloud-client $env:BUILD_DIR = $(${{ github.workspace }}/.github/workflows/.craft.ps1 -c --get buildDir -q owncloud-client) ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --run pwsh "${{ github.workspace }}/.github/workflows/.sonar.ps1" --build ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --install --qmerge owncloud/owncloud-client } else { ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" owncloud/owncloud-client } - name: Run tests run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --test owncloud/owncloud-client - name: Sonarcloud if: ${{ matrix.target == 'windows-msvc2017_64-cl' }} run: | $env:BUILD_DIR = $(${{ github.workspace }}/.github/workflows/.craft.ps1 -c --get buildDir -q owncloud-client) ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --run pwsh "${{ github.workspace }}/.github/workflows/.sonar.ps1" --analyze - name: Package run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --package owncloud/owncloud-client - name: Prepare artifacts run: | New-Item -ItemType Directory "${{ github.workspace }}/binaries/" -ErrorAction SilentlyContinue Copy-Item "$env:HOME/craft/binaries/*" "${{ github.workspace }}/binaries/" ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --shelve "${{ github.workspace }}/.craft.shelf" Copy-Item "${{ github.workspace }}/.craft.shelf" "${{ github.workspace }}/binaries/" - name: Upload artifacts uses: actions/upload-artifact@v2 with: name: ${{ matrix.os }} - ${{ matrix.target }} path: ${{ github.workspace }}/binaries/*