|
| 1 | +name: CANdevStudio |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + MAIN_BRANCH: 'refs/heads/master' |
| 7 | + |
| 8 | +jobs: |
| 9 | + Linux-Release: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + submodules: recursive |
| 16 | + |
| 17 | + - uses: jurplel/install-qt-action@v2 |
| 18 | + |
| 19 | + - uses: MarkusJx/install-boost@v1.0.1 |
| 20 | + id: install-boost |
| 21 | + with: |
| 22 | + boost_version: 1.73.0 |
| 23 | + |
| 24 | + - name: Create Build Environment |
| 25 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 26 | + |
| 27 | + - name: Configure CMake |
| 28 | + working-directory: ${{github.workspace}}/build |
| 29 | + run: cmake .. -DCMAKE_BUILD_TYPE=Release |
| 30 | + env: |
| 31 | + CXX: clang++ |
| 32 | + CC: clang |
| 33 | + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} |
| 34 | + |
| 35 | + - name: Build |
| 36 | + working-directory: ${{github.workspace}}/build |
| 37 | + run: make -j3 |
| 38 | + |
| 39 | + - name: Test |
| 40 | + working-directory: ${{github.workspace}}/build |
| 41 | + run: ctest |
| 42 | + env: |
| 43 | + QT_QPA_PLATFORM: offscreen |
| 44 | + |
| 45 | + - name: Create packages |
| 46 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 47 | + working-directory: ${{github.workspace}}/build |
| 48 | + run: | |
| 49 | + cpack -G DEB |
| 50 | + cmake . -DSTANDALONE=ON |
| 51 | + cpack -G TXZ |
| 52 | + mkdir ../master |
| 53 | + mv *.deb *.tar.xz ../master |
| 54 | +
|
| 55 | + - name: Get Pacakge Names |
| 56 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 57 | + id: package_names |
| 58 | + working-directory: ${{github.workspace}}/master |
| 59 | + run: | |
| 60 | + NORMAL=`ls *.deb` |
| 61 | + NORMAL_ZIP=${NORMAL%.deb} |
| 62 | + echo "::set-output name=NORMAL::$NORMAL" |
| 63 | + echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" |
| 64 | + STANDALONE=`ls *.tar.xz` |
| 65 | + STANDALONE_ZIP=${STANDALONE%.tar.xz} |
| 66 | + echo "::set-output name=STANDALONE::$STANDALONE" |
| 67 | + echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP" |
| 68 | +
|
| 69 | + - name: Upload Normal Package |
| 70 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 71 | + uses: actions/upload-artifact@v2 |
| 72 | + with: |
| 73 | + name: ${{steps.package_names.outputs.NORMAL_ZIP}} |
| 74 | + path: master/${{steps.package_names.outputs.NORMAL}} |
| 75 | + retention-days: 90 |
| 76 | + |
| 77 | + - name: Upload Standalone Package |
| 78 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 79 | + uses: actions/upload-artifact@v2 |
| 80 | + with: |
| 81 | + name: ${{steps.package_names.outputs.STANDALONE_ZIP}} |
| 82 | + path: master/${{steps.package_names.outputs.STANDALONE}} |
| 83 | + retention-days: 90 |
| 84 | + |
| 85 | + - name: Create RC packages |
| 86 | + if: startsWith(github.ref, 'refs/tags/') |
| 87 | + working-directory: ${{github.workspace}}/build |
| 88 | + run: | |
| 89 | + cmake . -DDEV_BUILD=OFF |
| 90 | + cpack -G TXZ |
| 91 | + cmake . -DSTANDALONE=ON |
| 92 | + cpack -G DEB |
| 93 | + mkdir ../rc |
| 94 | + mv *.deb *.tar.xz ../rc |
| 95 | +
|
| 96 | + - name: Upload RC packages |
| 97 | + if: startsWith(github.ref, 'refs/tags/') |
| 98 | + uses: actions/upload-artifact@v2 |
| 99 | + with: |
| 100 | + name: rc |
| 101 | + path: rc/* |
| 102 | + retention-days: 90 |
| 103 | + |
| 104 | + Linux-Debug: |
| 105 | + runs-on: ubuntu-latest |
| 106 | + |
| 107 | + steps: |
| 108 | + - uses: actions/checkout@v2 |
| 109 | + with: |
| 110 | + submodules: recursive |
| 111 | + |
| 112 | + - uses: jurplel/install-qt-action@v2 |
| 113 | + |
| 114 | + - uses: MarkusJx/install-boost@v1.0.1 |
| 115 | + id: install-boost |
| 116 | + with: |
| 117 | + boost_version: 1.73.0 |
| 118 | + |
| 119 | + - run: sudo apt install -y lcov |
| 120 | + |
| 121 | + - name: Create Build Environment |
| 122 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 123 | + |
| 124 | + - name: Configure CMake |
| 125 | + working-directory: ${{github.workspace}}/build |
| 126 | + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=ON -DWITH_TOOLS=ON |
| 127 | + env: |
| 128 | + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} |
| 129 | + |
| 130 | + - name: Build |
| 131 | + working-directory: ${{github.workspace}}/build |
| 132 | + run: make -j3 |
| 133 | + |
| 134 | + - name: Test |
| 135 | + working-directory: ${{github.workspace}}/build |
| 136 | + run: ctest |
| 137 | + env: |
| 138 | + QT_QPA_PLATFORM: offscreen |
| 139 | + |
| 140 | + - name: Generate Doxygen |
| 141 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 142 | + uses: mattnotmitt/doxygen-action@v1 |
| 143 | + with: |
| 144 | + doxyfile-path: 'Doxyfile' |
| 145 | + |
| 146 | + - name: Deploy Doxygen |
| 147 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 148 | + uses: peaceiris/actions-gh-pages@v3 |
| 149 | + with: |
| 150 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 151 | + publish_dir: ./html |
| 152 | + |
| 153 | + - name: Generate and Test Templates |
| 154 | + working-directory: ${{github.workspace}}/build |
| 155 | + env: |
| 156 | + QT_QPA_PLATFORM: offscreen |
| 157 | + run: | |
| 158 | + ./tools/templategen/templategen -n WithGUI -o ../src/components |
| 159 | + ./tools/templategen/templategen -n NoGUI -o ../src/components -g |
| 160 | + cmake . |
| 161 | + make -j3 |
| 162 | + make test |
| 163 | + rm -rf ../src/components/NoGUI ../src/components/WithGUI |
| 164 | +
|
| 165 | + - name: Code Coverage |
| 166 | + uses: codecov/codecov-action@v1 |
| 167 | + with: |
| 168 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 169 | + |
| 170 | + macOS-Release: |
| 171 | + runs-on: macos-latest |
| 172 | + steps: |
| 173 | + - uses: actions/checkout@v2 |
| 174 | + with: |
| 175 | + submodules: recursive |
| 176 | + |
| 177 | + - run: brew install cmake boost |
| 178 | + |
| 179 | + - uses: jurplel/install-qt-action@v2 |
| 180 | + |
| 181 | + - name: Create Build Environment |
| 182 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 183 | + |
| 184 | + - name: Configure CMake |
| 185 | + working-directory: ${{github.workspace}}/build |
| 186 | + run: cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=OFF |
| 187 | + env: |
| 188 | + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} |
| 189 | + |
| 190 | + - name: Build |
| 191 | + working-directory: ${{github.workspace}}/build |
| 192 | + run: make -j4 |
| 193 | + |
| 194 | + - name: Create packages |
| 195 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 196 | + working-directory: ${{github.workspace}}/build |
| 197 | + run: | |
| 198 | + cpack -G DragNDrop |
| 199 | + mkdir ../master |
| 200 | + mv *.dmg ../master |
| 201 | +
|
| 202 | + - name: Get Pacakge Names |
| 203 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 204 | + id: package_names |
| 205 | + working-directory: ${{github.workspace}}/master |
| 206 | + run: | |
| 207 | + NORMAL=`ls *.dmg` |
| 208 | + NORMAL_ZIP=${NORMAL%.dmg} |
| 209 | + echo "::set-output name=NORMAL::$NORMAL" |
| 210 | + echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" |
| 211 | +
|
| 212 | + - name: Upload Normal Package |
| 213 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 214 | + uses: actions/upload-artifact@v2 |
| 215 | + with: |
| 216 | + name: ${{steps.package_names.outputs.NORMAL_ZIP}} |
| 217 | + path: master/${{steps.package_names.outputs.NORMAL}} |
| 218 | + retention-days: 90 |
| 219 | + |
| 220 | + - name: Create RC packages |
| 221 | + if: startsWith(github.ref, 'refs/tags/') |
| 222 | + working-directory: ${{github.workspace}}/build |
| 223 | + run: | |
| 224 | + cmake . -DDEV_BUILD=OFF |
| 225 | + cpack -G DragNDrop |
| 226 | + mkdir ../rc |
| 227 | + mv *.dmg ../rc |
| 228 | +
|
| 229 | + - name: Upload RC packages |
| 230 | + if: startsWith(github.ref, 'refs/tags/') |
| 231 | + uses: actions/upload-artifact@v2 |
| 232 | + with: |
| 233 | + name: rc |
| 234 | + path: rc/* |
| 235 | + retention-days: 90 |
| 236 | + |
| 237 | + Windows-Release: |
| 238 | + runs-on: windows-latest |
| 239 | + steps: |
| 240 | + |
| 241 | + - uses: actions/checkout@v2 |
| 242 | + with: |
| 243 | + submodules: recursive |
| 244 | + |
| 245 | + - uses: jurplel/install-qt-action@v2 |
| 246 | + |
| 247 | + - uses: MarkusJx/install-boost@v1.0.1 |
| 248 | + id: install-boost |
| 249 | + with: |
| 250 | + boost_version: 1.73.0 |
| 251 | + |
| 252 | + - name: Create Build Environment |
| 253 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 254 | + |
| 255 | + - name: Configure CMake |
| 256 | + working-directory: ${{github.workspace}}/build |
| 257 | + run: cmake .. -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64 |
| 258 | + env: |
| 259 | + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} |
| 260 | + |
| 261 | + - name: Build |
| 262 | + working-directory: ${{github.workspace}}/build |
| 263 | + run: cmake --build . --config Release |
| 264 | + |
| 265 | + - name: Create Packages |
| 266 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 267 | + working-directory: ${{github.workspace}}/build |
| 268 | + run: | |
| 269 | + cpack -G 7Z |
| 270 | + cmake . -DSTANDALONE=ON |
| 271 | + cpack -G 7Z |
| 272 | + mkdir ..\master |
| 273 | + move *.7z ..\master |
| 274 | +
|
| 275 | + - name: Get Pacakge Names |
| 276 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 277 | + id: package_names |
| 278 | + shell: bash |
| 279 | + working-directory: ${{github.workspace}}/master |
| 280 | + run: | |
| 281 | + NORMAL=`ls *win64.7z` |
| 282 | + NORMAL_ZIP=${NORMAL%.7z} |
| 283 | + echo "::set-output name=NORMAL::$NORMAL" |
| 284 | + echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" |
| 285 | + STANDALONE=`ls *win64-standalone.7z` |
| 286 | + STANDALONE_ZIP=${STANDALONE%.7z} |
| 287 | + echo "::set-output name=STANDALONE::$STANDALONE" |
| 288 | + echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP" |
| 289 | +
|
| 290 | + - name: Upload Normal Package |
| 291 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 292 | + uses: actions/upload-artifact@v2 |
| 293 | + with: |
| 294 | + name: ${{steps.package_names.outputs.NORMAL_ZIP}} |
| 295 | + path: master\${{steps.package_names.outputs.NORMAL}} |
| 296 | + retention-days: 90 |
| 297 | + |
| 298 | + - name: Upload Standalone Package |
| 299 | + if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} |
| 300 | + uses: actions/upload-artifact@v2 |
| 301 | + with: |
| 302 | + name: ${{steps.package_names.outputs.STANDALONE_ZIP}} |
| 303 | + path: master\${{steps.package_names.outputs.STANDALONE}} |
| 304 | + retention-days: 90 |
| 305 | + |
| 306 | + - name: Create RC Packages |
| 307 | + if: startsWith(github.ref, 'refs/tags/') |
| 308 | + working-directory: ${{github.workspace}}/build |
| 309 | + run: | |
| 310 | + cmake . -DDEV_BUILD=OFF |
| 311 | + cpack -G 7Z |
| 312 | + cmake . -DSTANDALONE=ON |
| 313 | + cpack -G 7Z |
| 314 | + mkdir ..\rc |
| 315 | + move *.7z ..\rc |
| 316 | +
|
| 317 | + - name: Upload RC packages |
| 318 | + if: startsWith(github.ref, 'refs/tags/') |
| 319 | + uses: actions/upload-artifact@v2 |
| 320 | + with: |
| 321 | + name: rc |
| 322 | + path: rc\* |
| 323 | + retention-days: 90 |
0 commit comments