|
| 1 | +name: Pull Request |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-linux: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout repository |
| 13 | + uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + submodules: recursive |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - name: Cache vcpkg artifacts |
| 19 | + uses: actions/cache@v4 |
| 20 | + with: |
| 21 | + path: | |
| 22 | + vcpkg/downloads |
| 23 | + vcpkg/buildtrees |
| 24 | + vcpkg/packages |
| 25 | + build/Release/vcpkg_installed |
| 26 | + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} |
| 27 | + restore-keys: | |
| 28 | + ${{ runner.os }}-vcpkg- |
| 29 | +
|
| 30 | + - name: Install system dependencies |
| 31 | + run: | |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install --no-install-recommends -y \ |
| 34 | + doxygen \ |
| 35 | + graphviz \ |
| 36 | + ninja-build \ |
| 37 | + libtommath1 \ |
| 38 | + libtomcrypt1 |
| 39 | +
|
| 40 | + - name: Install Firebird |
| 41 | + run: | |
| 42 | + wget -nv -O Firebird-5.0.3.1683-0-linux-x64.tar.gz \ |
| 43 | + "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-linux-x64.tar.gz" |
| 44 | + tar xzf Firebird-5.0.3.1683-0-linux-x64.tar.gz |
| 45 | + (cd Firebird-5.0.3.1683-0-linux-x64 && sudo ./install.sh -silent) |
| 46 | +
|
| 47 | + - name: Configure Firebird |
| 48 | + run: | |
| 49 | + { |
| 50 | + echo "FIREBIRD=/opt/firebird" |
| 51 | + echo "FIREBIRD_LOCK=${RUNNER_TEMP}" |
| 52 | + echo "LD_LIBRARY_PATH=/opt/firebird/lib:${LD_LIBRARY_PATH}" |
| 53 | + } >> "$GITHUB_ENV" |
| 54 | +
|
| 55 | + - name: Bootstrap vcpkg |
| 56 | + run: | |
| 57 | + ./vcpkg/bootstrap-vcpkg.sh -disableMetrics |
| 58 | +
|
| 59 | + - name: Configure CMake |
| 60 | + run: | |
| 61 | + cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja |
| 62 | +
|
| 63 | + - name: Build Release targets |
| 64 | + run: | |
| 65 | + cmake --build build/Release |
| 66 | +
|
| 67 | + - name: Run tests |
| 68 | + run: | |
| 69 | + ./build/Release/out/bin/fb-cpp-test --log_level=all |
| 70 | +
|
| 71 | + - name: Build documentation |
| 72 | + run: | |
| 73 | + cmake --build build/Release --target docs |
| 74 | +
|
| 75 | + build-windows: |
| 76 | + runs-on: windows-latest |
| 77 | + steps: |
| 78 | + - name: Checkout repository |
| 79 | + uses: actions/checkout@v4 |
| 80 | + with: |
| 81 | + submodules: recursive |
| 82 | + fetch-depth: 0 |
| 83 | + |
| 84 | + - name: Cache vcpkg artifacts |
| 85 | + uses: actions/cache@v4 |
| 86 | + with: |
| 87 | + path: | |
| 88 | + vcpkg/downloads |
| 89 | + vcpkg/buildtrees |
| 90 | + vcpkg/packages |
| 91 | + build/vcpkg_installed |
| 92 | + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} |
| 93 | + restore-keys: | |
| 94 | + ${{ runner.os }}-vcpkg- |
| 95 | +
|
| 96 | + - name: Install Firebird |
| 97 | + shell: cmd |
| 98 | + run: | |
| 99 | + set FB_ZIP=Firebird-5.0.3.1683-0-windows-x64.zip |
| 100 | + powershell Invoke-WebRequest ^ |
| 101 | + "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/$env:FB_ZIP" -OutFile "$env:FB_ZIP" |
| 102 | + 7z x -oC:\Firebird %FB_ZIP% |
| 103 | +
|
| 104 | + - name: Configure Firebird |
| 105 | + shell: cmd |
| 106 | + run: | |
| 107 | + echo C:\Firebird>>%GITHUB_PATH% |
| 108 | +
|
| 109 | + - name: Bootstrap vcpkg |
| 110 | + shell: cmd |
| 111 | + run: | |
| 112 | + vcpkg\bootstrap-vcpkg.bat -disableMetrics |
| 113 | +
|
| 114 | + - name: Configure CMake |
| 115 | + shell: cmd |
| 116 | + run: | |
| 117 | + cmake -S . -B build -G "Visual Studio 17 2022" |
| 118 | +
|
| 119 | + - name: Build Release targets |
| 120 | + shell: cmd |
| 121 | + run: | |
| 122 | + cmake --build build --config Release |
| 123 | +
|
| 124 | + - name: Run tests |
| 125 | + shell: cmd |
| 126 | + run: | |
| 127 | + build\out\bin\Release\fb-cpp-test.exe |
| 128 | +
|
| 129 | + build-macos: |
| 130 | + runs-on: macos-latest |
| 131 | + steps: |
| 132 | + - name: Checkout repository |
| 133 | + uses: actions/checkout@v4 |
| 134 | + with: |
| 135 | + submodules: recursive |
| 136 | + fetch-depth: 0 |
| 137 | + |
| 138 | + - name: Cache vcpkg artifacts |
| 139 | + uses: actions/cache@v4 |
| 140 | + with: |
| 141 | + path: | |
| 142 | + vcpkg/downloads |
| 143 | + vcpkg/buildtrees |
| 144 | + vcpkg/packages |
| 145 | + build/Release/vcpkg_installed |
| 146 | + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} |
| 147 | + restore-keys: | |
| 148 | + ${{ runner.os }}-vcpkg- |
| 149 | +
|
| 150 | + - name: Install Firebird |
| 151 | + run: | |
| 152 | + wget -nv -O Firebird-5.0.3.1683-0-macos-arm64.pkg \ |
| 153 | + "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-macos-arm64.pkg" |
| 154 | + sudo installer -verbose -pkg Firebird-5.0.3.1683-0-macos-arm64.pkg -target / |
| 155 | +
|
| 156 | + - name: Configure Firebird |
| 157 | + run: | |
| 158 | + { |
| 159 | + echo "FIREBIRD_LOCK=${RUNNER_TEMP}" |
| 160 | + echo "DYLD_LIBRARY_PATH=/Library/Frameworks/Firebird.framework/Resources/lib:${DYLD_LIBRARY_PATH}" |
| 161 | + echo "ISC_USER=sysdba" |
| 162 | + echo "ISC_PASSWORD=masterkey" |
| 163 | + } >> "$GITHUB_ENV" |
| 164 | +
|
| 165 | + - name: Bootstrap vcpkg |
| 166 | + run: | |
| 167 | + ./vcpkg/bootstrap-vcpkg.sh -disableMetrics |
| 168 | +
|
| 169 | + - name: Configure CMake |
| 170 | + run: | |
| 171 | + cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja |
| 172 | +
|
| 173 | + - name: Build Release targets |
| 174 | + run: | |
| 175 | + cmake --build build/Release |
| 176 | +
|
| 177 | + - name: Run tests |
| 178 | + run: | |
| 179 | + ./build/Release/out/bin/fb-cpp-test --log_level=all |
0 commit comments