|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'master' |
| 8 | + - 'starling-v*-release' |
| 9 | + - 'v*-release' |
| 10 | + tags: |
| 11 | + - 'v*' |
| 12 | + - 'starling-v*' |
| 13 | + |
| 14 | +jobs: |
| 15 | + |
| 16 | + windows: |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - {env: "MSVC", arch: "Win32"} |
| 21 | + - {env: "MSVC", arch: "x64"} |
| 22 | + - {env: "MinGW"} |
| 23 | + |
| 24 | + runs-on: windows-2019 |
| 25 | + |
| 26 | + steps: |
| 27 | + |
| 28 | + - name: Checkout source |
| 29 | + uses: actions/checkout@v2 |
| 30 | + with: |
| 31 | + submodules: recursive |
| 32 | + ssh-key: ${{ secrets.SSH_KEY }} |
| 33 | + |
| 34 | + - name: Install CMake |
| 35 | + run: | |
| 36 | + choco install -y --no-progress cmake |
| 37 | +
|
| 38 | + - name: Downgrade MinGW to 6.4.0 (MinGW) |
| 39 | + if: matrix.env == 'MinGW' |
| 40 | + run: | |
| 41 | + choco install -y --no-progress --allow-downgrade --version=6.4.0 mingw |
| 42 | +
|
| 43 | + - name: Install msys2 packages (MinGW) |
| 44 | + if: matrix.env == 'MinGW' |
| 45 | + uses: msys2/setup-msys2@v2 |
| 46 | + with: |
| 47 | + msystem: MINGW64 |
| 48 | + install: git base-devel |
| 49 | + update: true |
| 50 | + |
| 51 | + - name: Run build (MSVC) |
| 52 | + if: matrix.env == 'MSVC' |
| 53 | + env: |
| 54 | + CMAKE_GENERATOR: "Visual Studio 16 2019" |
| 55 | + run: | |
| 56 | + cmake -G "$env:CMAKE_GENERATOR" -A ${{ matrix.arch }} -S . -B build; |
| 57 | + cmake --build build --config Release; |
| 58 | + bash -c "ls -la ./build/Release/swiftnav.lib || exit 1" |
| 59 | +
|
| 60 | + - name: Run build (MinGW) |
| 61 | + if: matrix.env == 'MinGW' |
| 62 | + env: |
| 63 | + CMAKE_GENERATOR: "MinGW Makefiles" |
| 64 | + CC: gcc |
| 65 | + CXX: g++ |
| 66 | + run: | |
| 67 | + cmake -B build -S . -G "$env:CMAKE_GENERATOR"; |
| 68 | + cmake --build build |
| 69 | +
|
| 70 | + unix: |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + include: |
| 74 | + - {os: ubuntu-18.04, cc: "gcc-6", cxx: "g++-6", test_suite: "unit"} |
| 75 | + - {os: ubuntu-18.04, cc: "clang-6.0", cxx: "clang++-6.0", test_suite: "lint"} |
| 76 | + - {os: macos-10.15, cc: "clang", cxx: "clang++", test_suite: "unit"} |
| 77 | + |
| 78 | + runs-on: ${{ matrix.os }} |
| 79 | + |
| 80 | + steps: |
| 81 | + |
| 82 | + - name: Checkout source |
| 83 | + uses: actions/checkout@v2 |
| 84 | + with: |
| 85 | + submodules: recursive |
| 86 | + ssh-key: ${{ secrets.SSH_KEY }} |
| 87 | + |
| 88 | + - name: Add base packages and toolchain repository (Linux) |
| 89 | + if: matrix.os == 'ubuntu-18.04' |
| 90 | + run: | |
| 91 | + sudo apt-get update |
| 92 | + sudo apt-get install build-essential software-properties-common -y |
| 93 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 94 | + sudo apt-get update |
| 95 | +
|
| 96 | + - name: Install gcc-6 (Linux) |
| 97 | + if: matrix.os == 'ubuntu-18.04' && matrix.cc == 'gcc-6' |
| 98 | + run: | |
| 99 | + sudo apt-get install -y gcc-6 g++-6 |
| 100 | +
|
| 101 | + - name: Install clang-6.0 (Linux) |
| 102 | + if: matrix.os == 'ubuntu-18.04' && matrix.cc == 'clang-6.0' |
| 103 | + run: | |
| 104 | + sudo apt-get install -y clang-6.0 libc++-dev libc++abi-dev |
| 105 | +
|
| 106 | + - name: Install clang-{format,tidy} (Linux) |
| 107 | + if: matrix.os == 'ubuntu-18.04' && matrix.cc == 'clang-6.0' && matrix.test_suite == 'lint' |
| 108 | + run: | |
| 109 | + sudo apt-get install -y clang-format-6.0 clang-tidy-6.0 |
| 110 | +
|
| 111 | + - name: Run build |
| 112 | + env: |
| 113 | + CC: ${{ matrix.cc }} |
| 114 | + CXX: ${{ matrix.cxx }} |
| 115 | + TEST_SUITE: ${{ matrix.test_suite }} |
| 116 | + run: | |
| 117 | + bash ./ci-build.sh |
0 commit comments