Welcome to mirror list, hosted at ThFree Co, Russian Federation.

main.yml « workflows « .github - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5d6b2595224a85d8a0209e44b0f14402ee2ead13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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/*