feat: create database backup on server startup #10955
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
--- | |
name: Build - Ubuntu | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- "src/**" | |
merge_group: | |
push: | |
paths: | |
- "src/**" | |
branches: | |
- main | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 2 | |
MAKEFLAGS: "-j 2" | |
jobs: | |
cancel-runs: | |
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ github.token }} | |
job: | |
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} | |
name: ${{ matrix.os }}-${{ matrix.buildtype }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04] | |
buildtype: [linux-release, linux-debug] | |
include: | |
- os: ubuntu-22.04 | |
triplet: x64-linux | |
- os: ubuntu-24.04 | |
triplet: x64-linux | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
- name: Install Linux Dependencies | |
run: > | |
sudo apt-get update && sudo apt-get install ccache linux-headers-"$(uname -r)" | |
- name: Switch to gcc-12 on Ubuntu 22.04 | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt install gcc-12 g++-12 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12 | |
sudo update-alternatives --set gcc /usr/bin/gcc-12 | |
- name: Switch to gcc-14 on Ubuntu 24.04 | |
if: matrix.os == 'ubuntu-24.04' | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt-get update | |
sudo apt-get install gcc-14 g++-14 -y | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 --slave /usr/bin/g++ g++ /usr/bin/g++-14 --slave /usr/bin/gcov gcov /usr/bin/gcov-14 | |
sudo update-alternatives --set gcc /usr/bin/gcc-14 | |
- name: CCache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
max-size: "1G" | |
key: ccache-${{ matrix.os }}-${{ matrix.buildtype }} | |
restore-keys: | | |
ccache-${{ matrix.os }} | |
- name: Restore artifacts and install vcpkg | |
id: vcpkg-step | |
run: | | |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') | |
echo "vcpkg commit ID: $vcpkgCommitId" | |
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> "$GITHUB_ENV" | |
- name: Get vcpkg commit id from vcpkg.json | |
uses: lukka/run-vcpkg@main | |
with: | |
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git" | |
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }} | |
- name: Get latest CMake and ninja | |
uses: lukka/get-cmake@main | |
- name: Run CMake | |
uses: lukka/run-cmake@main | |
with: | |
configurePreset: ${{ matrix.buildtype }} | |
buildPreset: ${{ matrix.buildtype }} | |
configurePresetAdditionalArgs: "['-DBUILD_TESTS=ON']" | |
- name: Create and Upload Artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: canary-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }} | |
path: | | |
${{ github.workspace }}/build/${{ matrix.buildtype }}/bin/ | |
- name: Run Unit Tests | |
run: | | |
cd ${{ github.workspace }}/build/${{ matrix.buildtype }}/tests/unit | |
ctest --verbose | |
# - name: Run Integration Tests | |
# run: | | |
# cd ${{ github.workspace }}/build/${{ matrix.buildtype }}/tests/integration | |
# ctest --verbose |