Skip to content

Commit

Permalink
Clean up GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GenericMadScientist committed Dec 23, 2023
1 parent d909ff0 commit 23d1f93
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 134 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Compiler Warnings

on: push

jobs:
msvc:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*

- name: Install other dependencies
run: vcpkg --triplet x64-windows install boost-json boost-nowide boost-program-options boost-test libpng

- name: Make build directory
run: mkdir build

- name: Generate build files
working-directory: build
env:
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_TOOLCHAIN_FILE: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
run: cmake ..

- name: Build
working-directory: build
run: cmake --build . --verbose

apple-clang:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.4.*

- name: Install Boost
run: brew install boost

- name: Make build directory
run: mkdir build

- name: Generate build files
working-directory: build
run: cmake ..

- name: Build
working-directory: build
run: cmake --build . --verbose

linux-gcc:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*

- name: Install Boost 1.84.0
run: |
wget -O "$HOME/boost_1_84_0.tar.bz2" https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2
tar --bzip2 -xf "$HOME/boost_1_84_0.tar.bz2" -C "$HOME"
cd "$HOME/boost_1_84_0"
./bootstrap.sh --with-libraries=json,nowide,program_options,test --prefix=.
./b2 toolset=gcc-13 install > /dev/null
- name: Make build directory
run: mkdir build

- name: Generate build files
working-directory: build
env:
BOOST_ROOT: ~/boost_1_84_0
CXX: g++-13
run: cmake ..

- name: Build
working-directory: build
run: cmake --build . --verbose
74 changes: 48 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Release

on:
push:
Expand All @@ -18,7 +18,8 @@ jobs:
runs-on: windows-2022
needs: determine-version
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -30,20 +31,30 @@ jobs:
- name: Install other dependencies
run: vcpkg --triplet x64-windows-static-md install boost-json boost-nowide boost-program-options libpng

- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DENABLE_LTO=ON -DPACKAGE_TESTS=OFF -G "Visual Studio 17 2022" ..
cmake --build . --verbose --config Release
- name: Make build directory
run: mkdir build

- name: Prepare releases
- name: Generate build files
working-directory: build
env:
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_TOOLCHAIN_FILE: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
run: cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DENABLE_LTO=ON -DPACKAGE_TESTS=OFF ..

- name: Build
working-directory: build
run: cmake --build . --verbose --config Release

- name: Prepare CLI release
working-directory: build/Release
run: |
mkdir cli-artifacts
mkdir gui-artifacts
cd Release
mkdir ..\cli-artifacts
Move-Item -Path chopt.exe -Destination ..\cli-artifacts\CHOpt.exe
- name: Prepare GUI release
working-directory: build/Release
run: |
mkdir ..\gui-artifacts
Rename-Item choptgui.exe CHOpt.exe
$env:VCINSTALLDIR = "$env:ProgramFiles\Microsoft Visual Studio\2022\Enterprise\VC"
windeployqt --release --no-network --no-opengl-sw --no-svg --no-system-d3d-compiler --no-translations CHOpt.exe
Expand All @@ -66,7 +77,8 @@ jobs:
runs-on: macos-12
needs: determine-version
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -81,29 +93,35 @@ jobs:
- name: Make build directory
run: mkdir build

- name: Build
- name: Generate build files
working-directory: build
env:
CMAKE_BUILD_TYPE: Release
run: |
cmake -DENABLE_LTO=ON -DPACKAGE_TESTS=OFF -DBoost_USE_STATIC_LIBS=ON -DCMAKE_FIND_FRAMEWORK=LAST ..
cmake --build . --verbose
run: cmake -DENABLE_LTO=ON -DPACKAGE_TESTS=OFF -DBoost_USE_STATIC_LIBS=ON -DCMAKE_FIND_FRAMEWORK=LAST ..

- name: Prepare releases
- name: Build
working-directory: build
run: cmake --build . --verbose

- name: Prepare CLI release
working-directory: build
run: |
mkdir cli-artifacts
mkdir gui-artifacts
strip -x chopt
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/libpng16.16.dylib chopt
mv chopt cli-artifacts/CHOpt
cp /usr/local/Cellar/libpng/1.6.40/lib/libpng16.16.dylib cli-artifacts/libpng16.16.dylib
- name: Prepare GUI release
working-directory: build
run: |
mkdir gui-artifacts
mv choptgui.app CHOpt.app
mv CHOpt.app/Contents/MacOS/choptgui CHOpt.app/Contents/MacOS/CHOpt
sed -i "" "s/choptgui/CHOpt/g" CHOpt.app/Contents/Info.plist
macdeployqt CHOpt.app
mv CHOpt.app gui-artifacts/CHOpt.app
- name: Upload CLI release
uses: actions/upload-artifact@v3
with:
Expand All @@ -120,7 +138,8 @@ jobs:
runs-on: ubuntu-22.04
needs: determine-version
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -152,17 +171,20 @@ jobs:
working-directory: build
run: cmake --build . --verbose

- name: Prepare releases
- name: Prepare CLI release
working-directory: build
run: |
mkdir cli-artifacts
mkdir gui-artifacts
strip -s chopt
strip -s choptgui
mv chopt cli-artifacts/CHOpt
- name: Prepare GUI release
working-directory: build
run: |
mkdir -p gui-artifacts/libs
mkdir -p gui-artifacts/platforms
strip -s choptgui
mv choptgui gui-artifacts/CHOpt
mkdir gui-artifacts/libs
mkdir gui-artifacts/platforms
cp ../resources/CHOpt.sh gui-artifacts/CHOpt.sh
cp ${Qt6_DIR}/lib/libicudata.so.56 gui-artifacts/libs/libicudata.so.56
cp ${Qt6_DIR}/lib/libicui18n.so.56 gui-artifacts/libs/libicui18n.so.56
Expand Down
105 changes: 15 additions & 90 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: static-analysis
name: Static Analysis

on: push

jobs:
clang-tidy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -18,26 +19,28 @@ jobs:
sudo apt-get update
sudo apt-get install -y clang-tidy-16
- name: Install Boost 1.81.0
- name: Install Boost 1.84.0
run: |
wget -O "$HOME/boost_1_81_0.tar.bz2" https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
tar --bzip2 -xf "$HOME/boost_1_81_0.tar.bz2" -C "$HOME"
cd "$HOME/boost_1_81_0"
export CC=gcc-10
export CXX=g++-10
wget -O "$HOME/boost_1_84_0.tar.bz2" https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2
tar --bzip2 -xf "$HOME/boost_1_84_0.tar.bz2" -C "$HOME"
cd "$HOME/boost_1_84_0"
./bootstrap.sh --with-libraries=json,nowide,program_options,test --prefix=.
./b2 install > /dev/null
./b2 toolset=gcc-13 install > /dev/null
- name: Application files
run: clang-tidy-16 src/*.cpp gui/json_settings.cpp -- -Iinclude -Ilibs -Iextern/sightread/include -I$HOME/boost_1_81_0 -std=c++20
run: clang-tidy-16 src/*.cpp gui/json_settings.cpp -- -Iinclude -Ilibs -Iextern/sightread/include -isystem $HOME/boost_1_84_0 -std=c++20

- name: Test files
run: clang-tidy-16 tests/*_unittest.cpp -checks=-cppcoreguidelines-avoid-do-while,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-macro-usage,-clang-analyzer-*,-readability-function-cognitive-complexity,-readability-magic-numbers -- -Iinclude -Iextern/sightread/include -I$HOME/boost_1_81_0 -std=c++20
run: >
clang-tidy-16 tests/*_unittest.cpp
-checks=-cppcoreguidelines-avoid-do-while,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-macro-usage,-clang-analyzer-*,-readability-function-cognitive-complexity,-readability-magic-numbers
-- -Iinclude -Iextern/sightread/include -I$HOME/boost_1_84_0 -std=c++20
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Install clang-format-16
run: |
Expand All @@ -51,81 +54,3 @@ jobs:
run: |
clang-format-16 -i gui/*.hpp gui/*.cpp include/*.hpp src/*.cpp tests/*.cpp tests/*.hpp
git diff --color --exit-code
msvc-compiler-warnings:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*

- name: Install other dependencies
run: vcpkg --triplet x64-windows install boost-json boost-nowide boost-program-options boost-test libpng

- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -G "Visual Studio 17 2022" ..
cmake --build . --verbose
apple-clang-compiler-warnings:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.4.*

- name: Install other dependencies
run: brew install boost

- name: Build
run: |
mkdir build
cd build
cmake ..
cmake --build . --verbose
linux-gcc-compiler-warnings:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*

- name: Install Boost 1.84.0
run: |
wget -O "$HOME/boost_1_84_0.tar.bz2" https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2
tar --bzip2 -xf "$HOME/boost_1_84_0.tar.bz2" -C "$HOME"
cd "$HOME/boost_1_84_0"
./bootstrap.sh --with-libraries=json,nowide,program_options,test --prefix=.
./b2 toolset=gcc-13 install > /dev/null
- name: Make build directory
run: mkdir build

- name: Generate build files
working-directory: build
env:
BOOST_ROOT: ~/boost_1_84_0
CXX: g++-13
run: cmake ..

- name: Build
working-directory: build
run: cmake --build . --verbose
Loading

0 comments on commit 23d1f93

Please sign in to comment.