|
| 1 | +# - When a third-party action is added (i.e., `uses`), please also add it to `download-licenses` in Makefile. |
| 2 | +# - When a job is added/removed/renamed, please make corresponding changes in ci-docs.yaml. |
| 3 | +name: Benchmark |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + paths-ignore: |
| 9 | + - '**.md' |
| 10 | + - 'contrib/**' |
| 11 | + |
| 12 | +permissions: |
| 13 | + # deployments permission to deploy GitHub pages website |
| 14 | + deployments: write |
| 15 | + # contents permission to update benchmark contents in gh-pages branch |
| 16 | + contents: write |
| 17 | + |
| 18 | +jobs: |
| 19 | + benchmark: |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: |
| 24 | + [ ubuntu-latest ] |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
| 28 | + with: |
| 29 | + # We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail. |
| 30 | + fetch-depth: 0 |
| 31 | + submodules: true |
| 32 | + - name: Clean up previous files |
| 33 | + run: | |
| 34 | + sudo rm -rf /opt/finch |
| 35 | + sudo rm -rf ~/.finch |
| 36 | + sudo rm -rf ./_output |
| 37 | + if pgrep '^qemu-system'; then |
| 38 | + sudo pkill '^qemu-system' |
| 39 | + fi |
| 40 | + if pgrep '^socket_vmnet'; then |
| 41 | + sudo pkill '^socket_vmnet' |
| 42 | + fi |
| 43 | + - name: Install Dependencies |
| 44 | + run: sudo apt-get install -y golang lz4 automake autoconf libtool yq |
| 45 | + - name: Build project |
| 46 | + run: | |
| 47 | + make |
| 48 | + - name: Run benchmark |
| 49 | + run: make test-benchmark-container | tee benchmark-container.txt |
| 50 | + - name: Set OS info as env variable |
| 51 | + run: | |
| 52 | + echo "OS_VERSION=$(lsb_release -sr)" >> $GITHUB_ENV |
| 53 | + echo "ARCH=$(uname -m)" >> $GITHUB_ENV |
| 54 | + - name: Store benchmark result |
| 55 | + uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 # v1.20.3 |
| 56 | + with: |
| 57 | + name: Finch Benchmark |
| 58 | + tool: 'go' |
| 59 | + benchmark-data-dir-path: "dev/bench/comparison/${{ env.OS_VERSION }}/${{ env.ARCH }}" |
| 60 | + output-file-path: benchmark-container.txt |
| 61 | + - name: Push benchmark result |
| 62 | + run: git push 'https://github.com/coderbirju/finch.git' gh-pages:gh-pages |
0 commit comments