-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Main workflow - Avoid duplicate runs - Job dependencies - Dependencies caching - Job conditional execution
- Loading branch information
1 parent
e9b5ab8
commit bc38ed4
Showing
17 changed files
with
868 additions
and
522 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: 'Build DBus' | ||
description: 'Clone and build DBus' | ||
|
||
inputs: | ||
os: | ||
description: "Runner OS" | ||
type: string | ||
default: '' | ||
required: false | ||
|
||
arch: | ||
description: "Platform architecture" | ||
type: string | ||
default: '' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Dependencies | ||
shell: bash | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
sudo -H apt-get update -y | ||
sudo -H apt-get install -y jq curl | ||
- name: Build Expat | ||
uses: ./.github/actions/build-expat | ||
with: | ||
os: ${{ inputs.os }} | ||
arch: ${{ inputs.arch }} | ||
- name: Set env | ||
shell: bash | ||
run: | | ||
echo "EXPAT_ROOT=/tmp/expat/install" >> $GITHUB_ENV | ||
echo "DBUS_ROOT=/tmp/dbus/install" >> $GITHUB_ENV | ||
echo "CMAKE_PREFIX_PATH=/tmp/dbus/install:/tmp/expat/install" >> $GITHUB_ENV | ||
- name: Get latest DBus commit hash | ||
id: dbus-hash | ||
shell: bash | ||
run: | | ||
DBUS_HASH=$(curl -s https://gitlab.freedesktop.org/api/v4/projects/1187/repository/commits | jq -r '.[0].id') | ||
echo "value=$DBUS_HASH" >> $GITHUB_OUTPUT | ||
- name: Cache DBus | ||
id: cache-dbus | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/dbus/install | ||
key: ${{ inputs.os }}-${{ inputs.arch }}-dbus-${{ steps.dbus-hash.outputs.value }} | ||
|
||
- name: Build DBus | ||
if: steps.cache-dbus.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
git clone https://gitlab.freedesktop.org/dbus/dbus.git /tmp/dbus | ||
cd /tmp/dbus | ||
cmake -B build -DDBUS_SESSION_SOCKET_DIR=/usr/local/var/run/dbus/system_bus_socket -DDBUS_BUILD_TESTS=OFF | ||
cmake --build build --config Release --parallel 4 | ||
cmake --install build --prefix /tmp/dbus/install |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 'Build Expat' | ||
description: 'Clone and build Expat' | ||
inputs: | ||
os: | ||
description: "Runner OS" | ||
type: string | ||
default: '' | ||
required: false | ||
|
||
arch: | ||
description: "Platform architecture" | ||
type: string | ||
default: '' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get latest Expat commit hash | ||
id: expat-hash | ||
shell: bash | ||
run: | | ||
EXPAT_HASH=$(curl -s https://api.github.com/repos/libexpat/libexpat/commits/master | jq -r .sha) | ||
echo "value=$EXPAT_HASH" >> $GITHUB_OUTPUT | ||
echo "EXPAT_ROOT=/tmp/expat/install" >> $GITHUB_ENV | ||
echo "CMAKE_PREFIX_PATH=/tmp/expat/install" >> $GITHUB_ENV | ||
- name: Cache Expat | ||
id: cache-expat | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/expat/install | ||
key: ${{ inputs.os }}-${{ inputs.arch }}-expat-${{ steps.expat-hash.outputs.value }} | ||
|
||
- name: Build Expat | ||
if: steps.cache-expat.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
git clone https://github.com/libexpat/libexpat.git /tmp/expat | ||
cd /tmp/expat/expat | ||
cmake -B build -DEXPAT_BUILD_DOCS=OFF -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF | ||
cmake --build build --config Release --parallel 4 | ||
cmake --install build --prefix /tmp/expat/install |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: 'Setup CMake' | ||
description: 'Setup CMake' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: jwlawson/actions-setup-cmake@v2 | ||
with: | ||
cmake-version: '3.21' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Build GTest' | ||
description: 'Clone and build Google Test' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get latest GTest commit hash | ||
id: gtest-hash | ||
shell: bash | ||
run: | | ||
GTEST_HASH=$(curl -s https://api.github.com/repos/google/googletest/commits/main | jq -r .sha) | ||
echo "value=$GTEST_HASH" >> $GITHUB_OUTPUT | ||
- name: Cache GTest | ||
id: cache-gtest | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/googletest/install | ||
key: ${{ runner.os }}-${{ runner.arch }}-gtest-${{ steps.gtest-hash.outputs.value }} | ||
|
||
- name: Build GTest for Unix-like systems | ||
if: runner.os != 'Windows' && steps.cache-gtest.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
git clone https://github.com/google/googletest | ||
cd googletest | ||
cmake . -B build | ||
cmake --build ./build --config Release --parallel 4 | ||
cmake --install ./build --prefix ./install | ||
- name: Build GTest for Windows | ||
if: runner.os == 'Windows' && steps.cache-gtest.outputs.cache-hit != 'true' | ||
shell: cmd | ||
run: | | ||
git clone https://github.com/google/googletest | ||
cd googletest | ||
cmake . -B build -Dgtest_force_shared_crt=ON | ||
cmake --build .\build --config Release --parallel 4 | ||
cmake --install .\build --prefix .\install |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.