Skip to content

Commit

Permalink
chore: update global workflows (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
  • Loading branch information
LizardByte-bot and ReenigneArcher committed May 26, 2024
1 parent cb33552 commit 0f30a63
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 144 deletions.
28 changes: 28 additions & 0 deletions .codeql-prebuild-cpp-Linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# install dependencies for C++ analysis
set -e

sudo apt-get update -y

# allow newer gcc
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y

sudo apt-get install -y \
build-essential \
cmake \
libayatana-appindicator3-dev \
libglib2.0-dev \
libnotify-dev \
ninja-build

# clean apt cache
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

# build
mkdir -p build
cd build || exit 1
cmake -G Ninja ..
ninja

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
21 changes: 21 additions & 0 deletions .codeql-prebuild-cpp-Windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# install dependencies for C++ analysis
set -e

# update pacman
pacman --noconfirm -Suy

# install dependencies
pacman --noconfirm -S \
mingw-w64-ucrt-x86_64-binutils \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-ninja \
mingw-w64-ucrt-x86_64-toolchain

# build
mkdir -p build
cd build || exit 1
cmake -G Ninja ..
ninja

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
16 changes: 16 additions & 0 deletions .codeql-prebuild-cpp-macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# install dependencies for C++ analysis
set -e

# install dependencies
brew install \
cmake \
ninja

# build
mkdir -p build
cd build || exit 1
cmake -G Ninja ..
ninja

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
35 changes: 0 additions & 35 deletions .github/workflows/auto-create-pr.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/automerge.yml

This file was deleted.

48 changes: 24 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ jobs:
matrix:
include:
- os: macos-latest
cmake_generator: "Unix Makefiles"
make_command: "make"
shell: "bash"
- os: ubuntu-latest
appindicator: "libayatana-appindicator3-dev"
cmake_generator: "Unix Makefiles"
make_command: "make"
shell: "bash"
- os: ubuntu-latest
appindicator: "libappindicator3-dev"
cmake_generator: "Unix Makefiles"
make_command: "make"
shell: "bash"
- os: windows-latest
cmake_generator: "MinGW Makefiles"
make_command: "mingw32-make"
shell: "msys2 {0}"

name: Build (${{ matrix.os }} - ${{ matrix.appindicator || 'default' }})
Expand All @@ -59,22 +51,32 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
${{ matrix.appindicator }} \
libglib2.0-dev \
libnotify-dev \
ninja-build \
xvfb
- name: Setup Dependencies macOS
if: runner.os == 'macOS'
run: |
brew install \
cmake \
ninja
- name: Setup Dependencies Windows
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
update: true
install: >-
base-devel
make
mingw-w64-x86_64-binutils
mingw-w64-x86_64-cmake
mingw-w64-x86_64-toolchain
mingw-w64-ucrt-x86_64-binutils
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-toolchain
- name: Setup python
id: setup-python
Expand All @@ -98,23 +100,21 @@ jobs:
- name: Build
run: |
mkdir build
mkdir -p build
cd build
cmake \
-G "${{ matrix.cmake_generator }}" \
..
${{ matrix.make_command }} -j
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -G Ninja ..
ninja
- name: Run tests
id: test
working-directory: build/tests
working-directory: build
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
export DISPLAY=:1
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
fi
./test_tray --gtest_color=yes
./tests/test_tray --gtest_color=yes
- name: Generate gcov report
# any except canceled or skipped
Expand All @@ -123,12 +123,10 @@ jobs:
working-directory: build
run: |
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
${{ steps.python-path.outputs.python-path }} -m gcovr -r .. \
${{ steps.python-path.outputs.python-path }} -m gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--exclude '.*tests/.*' \
--exclude '.*third-party/.*' \
--xml-pretty \
-o coverage.xml
Expand All @@ -141,10 +139,12 @@ jobs:
fi
echo "flags=${flags}" >> $GITHUB_OUTPUT
# todo: upload coverage in separate job similar to LizardByte/libdisplaydevice
- name: Upload coverage
# any except canceled or skipped
if: >-
always() && (steps.test_report.outcome == 'success') &&
always() &&
steps.test_report.outcome == 'success' &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@v4
with:
Expand Down
Loading

0 comments on commit 0f30a63

Please sign in to comment.