|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: 0 0 * * * |
| 8 | + |
| 9 | +jobs: |
| 10 | + format: |
| 11 | + runs-on: ubuntu-18.04 |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v1 |
| 15 | + - uses: Geode-solutions/actions/clang-format@master |
| 16 | + env: |
| 17 | + GITHUB_TOKEN: ${{ secrets.TOKEN }} |
| 18 | + |
| 19 | + build-ubuntu: |
| 20 | + runs-on: ubuntu-18.04 |
| 21 | + needs: format |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + cc: [gcc, clang] |
| 25 | + cxx: [g++, clang++] |
| 26 | + config: [Debug, Release] |
| 27 | + exclude: |
| 28 | + - cc: gcc |
| 29 | + cxx: clang++ |
| 30 | + - cc: clang |
| 31 | + cxx: g++ |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v1 |
| 35 | + - uses: Geode-solutions/actions/get-release@master |
| 36 | + id: opengeode |
| 37 | + with: |
| 38 | + repository: OpenGeode |
| 39 | + file: '-Linux.tar.gz' |
| 40 | + token: ${{ secrets.TOKEN }} |
| 41 | + - name: Compile |
| 42 | + run: | |
| 43 | + mkdir -p build |
| 44 | + cd build |
| 45 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} .. |
| 46 | + cmake --build . -- -j2 |
| 47 | + env: |
| 48 | + CC: ${{ matrix.cc }} |
| 49 | + CXX: ${{ matrix.cxx }} |
| 50 | + - name: Test |
| 51 | + run: | |
| 52 | + mkdir -p test |
| 53 | + cd test |
| 54 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH="$GITHUB_WORKSPACE/build;$GITHUB_WORKSPACE/${{ steps.opengeode.outputs.path }}" ../tests |
| 55 | + cmake --build . -- -j2 |
| 56 | + ctest --output-on-failure |
| 57 | + env: |
| 58 | + CC: ${{ matrix.cc }} |
| 59 | + CXX: ${{ matrix.cxx }} |
| 60 | + - name: Kcov |
| 61 | + run: curl -s https://raw.githubusercontent.com/Geode-solutions/actions/master/kcov.sh | bash -s -- ${GITHUB_WORKSPACE}/build/bin |
| 62 | + if: matrix.cc == 'gcc' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/master') && matrix.config == 'Debug' |
| 63 | + - uses: codecov/codecov-action@v1.0.2 |
| 64 | + if: matrix.cc == 'gcc' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/master') && matrix.config == 'Debug' |
| 65 | + with: |
| 66 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 67 | + file: kcov/kcov-merged/cobertura.xml |
| 68 | + - name: Notify slack |
| 69 | + if: failure() && github.ref == 'refs/heads/master' |
| 70 | + uses: 8398a7/action-slack@v2 |
| 71 | + with: |
| 72 | + status: failure |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 76 | + |
| 77 | + build-mac: |
| 78 | + runs-on: macOS-10.14 |
| 79 | + needs: format |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + config: [Debug, Release] |
| 83 | + |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v1 |
| 86 | + - uses: Geode-solutions/actions/get-release@master |
| 87 | + id: opengeode |
| 88 | + with: |
| 89 | + repository: OpenGeode |
| 90 | + file: '-Darwin.tar.gz' |
| 91 | + token: ${{ secrets.TOKEN }} |
| 92 | + - name: Compile & Test |
| 93 | + run: | |
| 94 | + mkdir -p build |
| 95 | + cd build |
| 96 | + cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} .. |
| 97 | + cmake --build . |
| 98 | + ctest --output-on-failure |
| 99 | + - name: Notify slack |
| 100 | + if: failure() && github.ref == 'refs/heads/master' |
| 101 | + uses: 8398a7/action-slack@v2 |
| 102 | + with: |
| 103 | + status: failure |
| 104 | + env: |
| 105 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 106 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 107 | + |
| 108 | + build-mac-xcode: |
| 109 | + runs-on: macOS-10.14 |
| 110 | + needs: format |
| 111 | + strategy: |
| 112 | + matrix: |
| 113 | + config: [Debug, Release] |
| 114 | + |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v1 |
| 117 | + - uses: Geode-solutions/actions/get-release@master |
| 118 | + id: opengeode |
| 119 | + with: |
| 120 | + repository: OpenGeode |
| 121 | + file: '-Darwin.tar.gz' |
| 122 | + token: ${{ secrets.TOKEN }} |
| 123 | + - name: Compile & Test |
| 124 | + run: | |
| 125 | + mkdir -p build |
| 126 | + cd build |
| 127 | + cmake -G "Xcode" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} .. |
| 128 | + cmake --build . --config ${{ matrix.config }} |
| 129 | + ctest -C ${{ matrix.config }} --output-on-failure |
| 130 | + - name: Notify slack |
| 131 | + if: failure() && github.ref == 'refs/heads/master' |
| 132 | + uses: 8398a7/action-slack@v2 |
| 133 | + with: |
| 134 | + status: failure |
| 135 | + env: |
| 136 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 138 | + |
| 139 | + build-windows: |
| 140 | + runs-on: windows-2016 |
| 141 | + needs: format |
| 142 | + strategy: |
| 143 | + matrix: |
| 144 | + config: [Debug, Release] |
| 145 | + |
| 146 | + steps: |
| 147 | + - uses: actions/checkout@v1 |
| 148 | + - uses: Geode-solutions/actions/get-release@master |
| 149 | + id: opengeode |
| 150 | + with: |
| 151 | + repository: OpenGeode |
| 152 | + file: '-win64.zip' |
| 153 | + token: ${{ secrets.TOKEN }} |
| 154 | + - name: Compile & Test |
| 155 | + run: | |
| 156 | + mkdir -p build |
| 157 | + cd build |
| 158 | + cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} .. |
| 159 | + cmake --build . --config ${{ matrix.config }} |
| 160 | + ctest -C ${{ matrix.config }} --output-on-failure |
| 161 | + - name: Notify slack |
| 162 | + if: failure() && github.ref == 'refs/heads/master' |
| 163 | + uses: 8398a7/action-slack@v2 |
| 164 | + with: |
| 165 | + status: failure |
| 166 | + env: |
| 167 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 168 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 169 | + |
| 170 | + semantic-release: |
| 171 | + runs-on: ubuntu-18.04 |
| 172 | + needs: [build-ubuntu, build-mac, build-mac-xcode, build-windows] |
| 173 | + steps: |
| 174 | + - uses: actions/checkout@v1 |
| 175 | + - run: npx semantic-release |
| 176 | + env: |
| 177 | + GITHUB_TOKEN: ${{ secrets.TOKEN }} |
0 commit comments