|
| 1 | +# Benchmark libgit2 against the git reference implementation. |
| 2 | +name: Benchmark |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + schedule: |
| 7 | + - cron: '15 4 * * *' |
| 8 | + |
| 9 | +jobs: |
| 10 | + # Run our nightly builds. We build a matrix with the various build |
| 11 | + # targets and their details. Then we build either in a docker container |
| 12 | + # (Linux) or on the actual hosts (macOS, Windows). |
| 13 | + build: |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + platform: |
| 17 | + - name: "Linux (clang, OpenSSL)" |
| 18 | + env: |
| 19 | + CC: clang |
| 20 | + CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release |
| 21 | + CMAKE_BUILD_OPTIONS: --config Release |
| 22 | + id: linux |
| 23 | + os: ubuntu-latest |
| 24 | + setup-script: ubuntu |
| 25 | + - name: "macOS" |
| 26 | + os: macos-10.15 |
| 27 | + env: |
| 28 | + CC: clang |
| 29 | + CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release |
| 30 | + CMAKE_BUILD_OPTIONS: --config Release |
| 31 | + PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig |
| 32 | + id: macos |
| 33 | + setup-script: osx |
| 34 | + - name: "Windows (amd64, Visual Studio)" |
| 35 | + os: windows-2019 |
| 36 | + env: |
| 37 | + ARCH: amd64 |
| 38 | + CMAKE_GENERATOR: Visual Studio 16 2019 |
| 39 | + CMAKE_OPTIONS: -A x64 -DDEPRECATE_HARD=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release |
| 40 | + CMAKE_BUILD_OPTIONS: --config Release |
| 41 | + id: windows |
| 42 | + setup-script: win32 |
| 43 | + fail-fast: false |
| 44 | + name: "Build ${{ matrix.platform.name }}" |
| 45 | + env: ${{ matrix.platform.env }} |
| 46 | + runs-on: ${{ matrix.platform.os }} |
| 47 | + steps: |
| 48 | + - name: Check out repository |
| 49 | + uses: actions/checkout@v2 |
| 50 | + with: |
| 51 | + path: source |
| 52 | + fetch-depth: 0 |
| 53 | + - name: Set up benchmark environment |
| 54 | + run: source/ci/setup-${{ matrix.platform.setup-script }}-benchmark.sh |
| 55 | + shell: bash |
| 56 | + if: matrix.platform.setup-script != '' |
| 57 | + - name: Build |
| 58 | + run: | |
| 59 | + mkdir build && cd build |
| 60 | + ../source/ci/build.sh |
| 61 | + shell: bash |
| 62 | + - name: Benchmark |
| 63 | + run: | |
| 64 | + if [[ "$(uname -s)" == MINGW* ]]; then |
| 65 | + GIT2_CLI="$(cygpath -w $(pwd))\\build\\Release\\git2_cli" |
| 66 | + else |
| 67 | + GIT2_CLI="$(pwd)/build/git2_cli" |
| 68 | + fi |
| 69 | +
|
| 70 | + mkdir benchmark && cd benchmark |
| 71 | + ../source/tests/benchmarks/benchmark.sh --baseline-cli "git" --cli "${GIT2_CLI}" --json benchmarks.json --zip benchmarks.zip |
| 72 | + shell: bash |
| 73 | + - name: Upload results |
| 74 | + uses: actions/upload-artifact@v2 |
| 75 | + with: |
| 76 | + name: benchmark-${{ matrix.platform.id }} |
| 77 | + path: benchmark |
| 78 | + if: always() |
0 commit comments