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

main.yml « workflows « .github - github.com/SpectrumIM/spectrum2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d62d3c6a9c5018a20dd57d0a63a05b70880fc96 (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
name: CI

on:
  pull_request:
  push:
    branches: master

jobs:
  linux-glibc:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Build tests
      run: |
        echo "::add-matcher::.github/gcc.json" 
        docker buildx build . --target test -t spectrum:tests
    - name: Run tests
      run: docker run -tt spectrum:tests
  linux-clang:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Build tests
      run: docker buildx build . --target test-clang -t spectrum:tests-clang
    - name: Run tests
      run: docker run -tt spectrum:tests-clang
  linux-musl:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Build tests
      run: docker buildx build . --target test-musl -t spectrum:tests-musl
    - name: Run tests
      run: docker run -tt --env LANG=en_US.UTF-8 spectrum:tests-musl
  macos:
    runs-on: macOS-11.0
    steps:
    - uses: actions/checkout@v2
    - name: Install MacPorts
      run: |
        curl -L -O "https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg"
        sudo installer -store -pkg MacPorts-2.7.1-11-BigSur.pkg -target /
        echo "https://packages.spectrum.im/macports/ports.tar.bz2" | sudo tee -a /opt/local/etc/macports/sources.conf
    - name: Install dependencies
      run: |
        export PATH=$PATH:/opt/local/bin
        sudo rm -rf /usr/local/*
        sudo port -v selfupdate && sudo port -q install cppunit log4cxx popt jsoncpp protobuf3-cpp pkgconfig boost cmake zlib libswiften
    - name: Configure build
      run: |
        export PATH=$PATH:/opt/local/bin:/usr/local/bin
        cmake -DCMAKE_BUILD_TYPE=MacPorts -DENABLE_TESTS=ON -DCMAKE_UNITY_BUILD=ON .
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: cpp
    - name: Build
      run:  make -j4
    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v1
    - name: Run tests
      run:  |
        install_name_tool -change libSwiften.4.dylib @rpath/libSwiften.4.dylib tests/libtransport/libtransport_test
        install_name_tool -add_rpath /opt/local/lib tests/libtransport/libtransport_test
        install_name_tool -change libSwiften.4.dylib @rpath/libSwiften.4.dylib libtransport/libtransport.2.0.dylib
        install_name_tool -add_rpath /opt/local/lib libtransport/libtransport.2.0.dylib
        make test
    

  windows:
    runs-on: windows-2022
    steps:
    - uses: actions/checkout@v2
    - name: Install dependencies
      run: |
        curl -L -O https://packages.spectrum.im/deps32.zip
        7z x deps32.zip
      shell: cmd
    - name: Add msbuild to PATH
      uses: microsoft/setup-msbuild@v1.0.2
    - name: Configure build
      run: |
        set CMAKE_PREFIX_PATH=%cd%\deps32
        set PATH=%PATH%;%cd%\deps32\bin;%cd%\deps32\tools\bin
        cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_IRC=OFF -DENABLE_FROTZ=OFF -DENABLE_PURPLE=OFF -DENABLE_MYSQL=OFF -DENABLE_PQXX=OFF -DCMAKE_INSTALL_PREFIX=dist .
      shell: cmd
    - name: Build solution
      run:  msbuild /t:Build INSTALL.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=Win32 /m
    - name: Run tests
      shell: cmd
      run: |
        set PATH=%PATH%;%cd%\deps32\bin
        cd tests\libtransport\RelWithDebInfo
        libtransport_test