Skip to content

Cache plugins' master flag #533

Cache plugins' master flag

Cache plugins' master flag #533

Workflow file for this run

name: CI
on:
push:
# Don't run this workflow when a tag is pushed.
branches:
- '*'
pull_request:
env:
BOOST_VERSION: 1.87.0
CARGO_TERM_COLOR: always
MSVC_CONFIG: RelWithDebInfo
jobs:
linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Get descriptive libloot version
id: get-libloot-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
LIBLOOT_DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
LIBLOOT_SAFE_DESC_REF=${LIBLOOT_DESC_REF//[\/<>\"|]/_}
echo "version=$LIBLOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Get Boost metadata
id: boost-metadata
run: |
BOOST_ROOT="${{ github.workspace }}/boost_${BOOST_VERSION//./_}"
echo "root=$BOOST_ROOT" >> $GITHUB_OUTPUT
- name: Boost cache
id: boost-cache
uses: actions/cache@v4
with:
path: |
${{ steps.boost-metadata.outputs.root }}/boost
${{ steps.boost-metadata.outputs.root }}/stage
key: ${{ runner.os }}-Boost-${{ env.BOOST_VERSION }}
# Need to build Boost's 'system' stub to generate the CMake config file.
- name: Download & build Boost
run: |
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
python install_boost.py --directory ${{ github.workspace }} --boost-version $BOOST_VERSION -a 64 system
if: steps.boost-cache.outputs.cache-hit != 'true'
- name: Install APT package dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-upgrade \
cbindgen \
doxygen \
language-pack-el \
language-pack-tr \
libtbb-dev \
libicu-dev
- name: Run CMake
run: |
cmake \
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" \
-DCPACK_PACKAGE_VERSION="${{ steps.get-libloot-version.outputs.version }}" \
-B build
cmake --build build
- name: Run tests
run: ctest --test-dir build --output-on-failure --parallel
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install packages for building docs
shell: bash
run: |
pip3 install --user -r docs/requirements.txt
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build docs
run: sphinx-build -b html docs build/docs/html
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack
VERSION="${{ steps.get-libloot-version.outputs.version }}"
echo "filename=libloot-${VERSION}-Linux.tar.xz" >> $GITHUB_OUTPUT
- name: Import GPG key
run: echo -n "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
if: github.event_name == 'push'
- name: Sign archive
run: gpg --output "build/package/${{ steps.build-archive.outputs.filename }}.sig" --detach-sig "build/package/${{ steps.build-archive.outputs.filename }}"
if: github.event_name == 'push'
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-archive.outputs.filename }}
path: |
build/package/${{ steps.build-archive.outputs.filename }}
build/package/${{ steps.build-archive.outputs.filename }}.sig
if: github.event_name == 'push'
windows:
runs-on: windows-2019
strategy:
matrix:
platform: [Win32, x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust i686-pc-windows-msvc target
run: rustup target add i686-pc-windows-msvc
- name: Get Boost metadata
id: boost-metadata
run: |
$BOOST_ROOT="${{ github.workspace }}/boost_" + $env:BOOST_VERSION -replace "\.", "_"
echo "root=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Boost cache
id: boost-cache
uses: actions/cache@v4
with:
path: |
${{ steps.boost-metadata.outputs.root }}/boost
${{ steps.boost-metadata.outputs.root }}/stage
key: ${{ runner.os }}-x64-Boost-${{ env.BOOST_VERSION }}
# Need to build Boost's 'system' stub to generate the CMake config file.
- name: Download & build Boost
run: |
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
python install_boost.py --directory ${{ github.workspace }} --boost-version ${{ env.BOOST_VERSION }} -a 64 system
if: steps.boost-cache.outputs.cache-hit != 'true'
- name: Get descriptive libloot version
id: get-libloot-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
LIBLOOT_DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
LIBLOOT_SAFE_DESC_REF=${LIBLOOT_DESC_REF//[\/<>\"|]/_}
echo "version=$LIBLOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
cmake -G "Visual Studio 16 2019" `
-A ${{ matrix.platform }} `
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" `
-DCPACK_PACKAGE_VERSION="${{ steps.get-libloot-version.outputs.version }}" `
-B build
cmake --build build --config ${{ env.MSVC_CONFIG }}
- name: Run tests
run: ctest --test-dir build --build-config ${{ env.MSVC_CONFIG }} --output-on-failure --parallel
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install packages for building docs
run: |
nuget install doxygen -Version 1.8.14
echo "${{ github.workspace }}\Doxygen.1.8.14\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
python -m pip install -r docs/requirements.txt
- name: Build docs
run: sphinx-build -b html docs build\docs\html
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack -C ${{ env.MSVC_CONFIG }}
VERSION="${{ steps.get-libloot-version.outputs.version }}"
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=win32
else
PLATFORM=win64
fi
echo "filename=libloot-${VERSION}-${PLATFORM}.7z" >> $GITHUB_OUTPUT
- name: Import GPG key
run: echo -n "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
if: github.event_name == 'push'
- name: Sign archive
run: gpg --output "build/package/${{ steps.build-archive.outputs.filename }}.sig" --detach-sig "build/package/${{ steps.build-archive.outputs.filename }}"
if: github.event_name == 'push'
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-archive.outputs.filename }}
path: |
build/package/${{ steps.build-archive.outputs.filename }}
build/package/${{ steps.build-archive.outputs.filename }}.sig
if: github.event_name == 'push'