Implemented a github action step that pre-compiles all conan

dependencies and caches them for use in later builds, improving build
speed.

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
This commit is contained in:
Ibrahim Zidan 2026-07-13 02:02:59 +03:00
parent 072edfbdc2
commit 3d3a63914c
No known key found for this signature in database
GPG key ID: 0F0A43C7FE4C7B9A
7 changed files with 113 additions and 5 deletions

View file

@ -74,6 +74,13 @@ jobs:
run: |
uname -a
- uses: actions/cache/restore@v6
name: restore conan cache
id: cache
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: install packages
run: |
./tools/ci/retry.sh apt-get update

View file

@ -15,6 +15,10 @@ jobs:
needs: hwsapibot
if: ${{ !failure() && !cancelled() }}
uses: ./.github/workflows/tools.yml
tools-windows:
needs: hwsapibot
if: ${{ !failure() && !cancelled() }}
uses: ./.github/workflows/tools-windows.yml
build:
needs: tools
if: ${{ !failure() && !cancelled() }}
@ -48,6 +52,6 @@ jobs:
# if: ${{ !failure() && !cancelled() }}
# uses: ./.github/workflows/macos_m1.yml
windows:
needs: tools
needs: tools-windows
if: ${{ !failure() && !cancelled() }}
uses: ./.github/workflows/windows.yml

View file

@ -69,6 +69,13 @@ jobs:
run: |
uname -a
- uses: actions/cache/restore@v6
name: restore conan cache
id: cache
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: install packages
run: |
./tools/ci/retry.sh apt-get update

View file

@ -78,6 +78,13 @@ jobs:
run: |
uname -a
- uses: actions/cache/restore@v6
name: restore conan cache
id: cache
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: install packages
run: |
./tools/ci/retry.sh apt-get update

43
.github/workflows/tools-windows.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: tools-windows
on: workflow_call
jobs:
build:
runs-on: windows-2025
timeout-minutes: 30
strategy:
matrix:
CC: [msvc]
# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: tools-windows-${{ github.head_ref || github.run_id }}_${{ matrix.CC }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: actions/cache/restore@v6 # We're restoring first so if a cache already exists from previous CI run, it's used and step finishes quicker.
name: restore conan cache
id: cache-restore
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: run cmake first run
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
./setup_env.ps1
- uses: actions/cache/save@v6
if: steps.cache-restore.outputs.cache-hit != 'true'
name: save conan cache
id: cache_save
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}

View file

@ -7,20 +7,31 @@ env:
MYSQL_USER: 'ragnarok'
MYSQL_PASSWORD: 'ragnarok'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
DEBIAN_COMMON_PACKAGES: python3 python3-pip
DEBIAN_COMMON_PACKAGES: python3 python3-pip python3-venv cmake make git gcc g++
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
CC: ["clang-21", "gcc-15"]
include:
- CXX: 'g++-15'
CC: 'gcc-15'
- CXX: 'clang++-21'
CC: 'clang-21'
# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: tools-${{ github.head_ref || github.run_id }}
group: tools-linux-${{ github.head_ref || github.run_id }}_${{ matrix.CC }}
cancel-in-progress: true
container:
image: debian:unstable
image: ubuntu:26.04
steps:
- uses: actions/checkout@v6
with:
@ -33,9 +44,31 @@ jobs:
- name: install packages
run: |
./tools/ci/retry.sh apt-get update
./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES
./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES ${{ matrix.CC }} ${{ matrix.CXX }}
pip3 install sqlfluff --break-system-packages
- uses: actions/cache/restore@v6 # We're restoring first so if a cache already exists from previous CI run, it's used and step finishes quicker.
name: restore conan cache
id: cache-restore
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: run cmake first run
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
./tools/ci/travis.sh prepareenv
source .venv/bin/activate
cmake -S . -B build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake_modules/conan_provider.cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.CC }} -DCMAKE_CXX_COMPILER=${{ matrix.CXX }}
- uses: actions/cache/save@v6
if: steps.cache-restore.outputs.cache-hit != 'true'
name: save conan cache
id: cache_save
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- name: check sql syntax
run: |
./tools/ci/retry.sh python3 tools/validate_sql-files.py

View file

@ -45,6 +45,13 @@ jobs:
# run: |
# winget install Ninja-build.Ninja cmake python3 --accept-source-agreements --accept-package-agreements --disable-interactivity --silent
- uses: actions/cache/restore@v6
name: restore conan cache
id: cache
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.CC }}-${{ hashFiles('conanfile.py') }}
- uses: shogo82148/actions-setup-mysql@v1
with:
distribution: "mariadb"