Add pre-requisite install to Linux build steps #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CANdevStudio | |
on: [push, pull_request] | |
env: | |
MAIN_BRANCH: 'refs/heads/master' | |
jobs: | |
Linux-Release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: jurplel/install-qt-action@v2 | |
- uses: MarkusJx/install-boost@v1.0.1 | |
id: install-boost | |
with: | |
boost_version: 1.73.0 | |
- run: sudo apt install libxcb-xinerama0 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake .. -DCMAKE_BUILD_TYPE=Release | |
env: | |
CXX: clang++ | |
CC: clang | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: make -j3 | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest --output-on-failure | |
env: | |
QT_QPA_PLATFORM: offscreen | |
- name: Create packages | |
if: startsWith(github.ref, 'refs/heads/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cpack -G DEB | |
cmake . -DSTANDALONE=ON | |
cpack -G TXZ | |
mkdir ../master | |
mv *.deb *.tar.xz ../master | |
- name: Get Package Names | |
if: startsWith(github.ref, 'refs/heads/') | |
id: package_names | |
working-directory: ${{github.workspace}}/master | |
run: | | |
NORMAL=`ls *.deb` | |
NORMAL_ZIP=${NORMAL%.deb} | |
echo "::set-output name=NORMAL::$NORMAL" | |
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" | |
STANDALONE=`ls *.tar.xz` | |
STANDALONE_ZIP=${STANDALONE%.tar.xz} | |
echo "::set-output name=STANDALONE::$STANDALONE" | |
echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP" | |
- name: Upload Normal Package | |
if: startsWith(github.ref, 'refs/heads/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{steps.package_names.outputs.NORMAL_ZIP}} | |
path: master/${{steps.package_names.outputs.NORMAL}} | |
retention-days: 90 | |
- name: Upload Standalone Package | |
if: startsWith(github.ref, 'refs/heads/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{steps.package_names.outputs.STANDALONE_ZIP}} | |
path: master/${{steps.package_names.outputs.STANDALONE}} | |
retention-days: 90 | |
- name: Create RC packages | |
if: startsWith(github.ref, 'refs/tags/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cmake . -DDEV_BUILD=OFF | |
cpack -G TXZ | |
cmake . -DSTANDALONE=ON | |
cpack -G DEB | |
mkdir ../rc | |
mv *.deb *.tar.xz ../rc | |
- name: Upload RC packages | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rc | |
path: rc/* | |
retention-days: 90 | |
Linux-Debug: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: jurplel/install-qt-action@v2 | |
- uses: MarkusJx/install-boost@v1.0.1 | |
id: install-boost | |
with: | |
boost_version: 1.73.0 | |
- run: sudo apt install -y lcov | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=ON -DWITH_TOOLS=ON | |
env: | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: make -j3 | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest --output-on-failure | |
env: | |
QT_QPA_PLATFORM: offscreen | |
- name: Generate Doxygen | |
if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} | |
uses: mattnotmitt/doxygen-action@v1 | |
with: | |
doxyfile-path: 'Doxyfile' | |
- name: Deploy Doxygen | |
if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./html | |
- name: Generate and Test Templates | |
working-directory: ${{github.workspace}}/build | |
env: | |
QT_QPA_PLATFORM: offscreen | |
run: | | |
./tools/templategen/templategen -n WithGUI -o ../src/components | |
./tools/templategen/templategen -n NoGUI -o ../src/components -g | |
cmake . | |
make -j3 | |
make test | |
rm -rf ../src/components/NoGUI ../src/components/WithGUI | |
- name: Code Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
macOS-Release: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- run: brew install cmake boost qt5 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)/lib/cmake" | |
env: | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: make -j4 | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest --output-on-failure | |
env: | |
QT_QPA_PLATFORM: offscreen | |
- name: Create packages | |
if: startsWith(github.ref, 'refs/heads/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cpack -G DragNDrop | |
mkdir ../master | |
mv *.dmg ../master | |
- name: Get Package Names | |
if: startsWith(github.ref, 'refs/heads/') | |
id: package_names | |
working-directory: ${{github.workspace}}/master | |
run: | | |
NORMAL=`ls *.dmg` | |
NORMAL_ZIP=${NORMAL%.dmg} | |
echo "::set-output name=NORMAL::$NORMAL" | |
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" | |
- name: Upload Normal Package | |
if: startsWith(github.ref, 'refs/heads/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{steps.package_names.outputs.NORMAL_ZIP}} | |
path: master/${{steps.package_names.outputs.NORMAL}} | |
retention-days: 90 | |
- name: Create RC packages | |
if: startsWith(github.ref, 'refs/tags/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cmake . -DDEV_BUILD=OFF | |
cpack -G DragNDrop | |
mkdir ../rc | |
mv *.dmg ../rc | |
- name: Upload RC packages | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rc | |
path: rc/* | |
retention-days: 90 | |
Windows-Release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: jurplel/install-qt-action@v2 | |
- uses: MarkusJx/install-boost@v1.0.1 | |
id: install-boost | |
with: | |
boost_version: 1.73.0 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake .. -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64 | |
env: | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build . --config Release -- /m | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C Release --output-on-failure | |
env: | |
QT_QPA_PLATFORM: offscreen | |
- name: Create Packages | |
if: startsWith(github.ref, 'refs/heads/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cpack -G 7Z | |
cmake . -DSTANDALONE=ON | |
cpack -G 7Z | |
mkdir ..\master | |
move *.7z ..\master | |
- name: Get Package Names | |
if: startsWith(github.ref, 'refs/heads/') | |
id: package_names | |
shell: bash | |
working-directory: ${{github.workspace}}/master | |
run: | | |
NORMAL=`ls *Windows.7z` | |
NORMAL_ZIP=${NORMAL%.7z} | |
echo "::set-output name=NORMAL::$NORMAL" | |
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP" | |
STANDALONE=`ls *Windows-standalone.7z` | |
STANDALONE_ZIP=${STANDALONE%.7z} | |
echo "::set-output name=STANDALONE::$STANDALONE" | |
echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP" | |
- name: Upload Normal Package | |
if: startsWith(github.ref, 'refs/heads/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{steps.package_names.outputs.NORMAL_ZIP}} | |
path: master\${{steps.package_names.outputs.NORMAL}} | |
retention-days: 90 | |
- name: Upload Standalone Package | |
if: startsWith(github.ref, 'refs/heads/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{steps.package_names.outputs.STANDALONE_ZIP}} | |
path: master\${{steps.package_names.outputs.STANDALONE}} | |
retention-days: 90 | |
- name: Create RC Packages | |
if: startsWith(github.ref, 'refs/tags/') | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cmake . -DDEV_BUILD=OFF | |
cpack -G 7Z | |
cmake . -DSTANDALONE=ON | |
cpack -G 7Z | |
mkdir ..\rc | |
move *.7z ..\rc | |
- name: Upload RC packages | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rc | |
path: rc\* | |
retention-days: 90 |