bobheadxi / gobenchdata

📉 Run Go benchmarks, publish results to an interactive web app, and check for performance regressions in your pull requests
https://gobenchdata.bobheadxi.dev
MIT License
142 stars 14 forks source link

Feature: specify Go version in GitHub Action #41

Closed hazcod closed 2 years ago

hazcod commented 4 years ago

Hi,

Is there a way to specify the Go version to use when using gobenchdata? e.g.in my case the Go version is pinned down, and I like to see performance changes between Go versions. Thank you!

e.g. https://github.com/ironPeakServices/iron-go-project/blob/master/.github/workflows/build.yml#L20

bobheadxi commented 4 years ago

Unfortunately not at the moment - the Go version is baked in: https://github.com/bobheadxi/gobenchdata/blob/master/Dockerfile#L1

but this is a valid use case! I will investigate how to best incorporate this into the default action. In the meantime, you can also use the CLI directly to achieve the exact same behaviour as the Action using your specified version of Go, something like:

      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ steps.vars.outputs.go_version }}
      - name: Install gobenchdata
        run: go get go.bobheadxi.dev/gobenchdata
      - name: Run gobenchdata
        run: go test -bench | gobenchdata --json "${RUN_OUTPUT}" -v "${GITHUB_SHA}" -t "ref=${GITHUB_REF}"

or similar - see entrypoint.sh for more details, or feel free to ping back here if you have any questions!

bobheadxi commented 4 years ago

unfortunately, the easiest way for me to support this is via --build-arg, which GitHub Actions does not currently support

hazcod commented 4 years ago

Not sure why it's exiting here. Implementing in https://github.com/ironPeakServices/iron-go-project/pull/11/

hazcod commented 4 years ago

@bobheadxi : i've made progress with this, but i's complaining about my empty benchmarks.json file: https://github.com/ironpeakservices/iron-go-project/runs/795465395?check_suite_focus=true#step:7:41

bobheadxi commented 3 years ago

I think this might be possible by migrating to https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions , and leveraging any setup-go a user has run beforehand

bobheadxi commented 2 years ago

You will soon be able to do this with https://github.com/bobheadxi/gobenchdata#custom-setup :)