Skip to content

feat: build golang tests with codspeed instrumentation #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: cod-1172-create-codspeed-go-repository-with-the-compat-layer
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go-runner/testdata/raw_results/*.json filter=lfs diff=lfs merge=lfs -text
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,54 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v5
- uses: moonrepo/setup-rust@v1
with:
components: rustfmt, clippy
- uses: pre-commit/[email protected]
with:
extra_args: --all-files

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: true
- uses: moonrepo/setup-rust@v1
- run: |
cd go-runner
cargo test --all


compat-integration-test-walltime:
runs-on: codspeed-macro
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v5
- uses: moonrepo/setup-rust@v1
with:
cache-target: release

- name: Run the benchmarks
uses: CodSpeedHQ/action@main
with:
working-directory: example
run: cargo r --manifest-path ../go-runner/Cargo.toml -- test -bench=.

check:
runs-on: ubuntu-latest
if: always()
needs:
- lint
- tests
- compat-integration-test-walltime
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJson( needs ) }}
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[submodule "go-runner/testdata/projects/fzf"]
path = go-runner/testdata/projects/fzf
url = https://github.com/junegunn/fzf
[submodule "go-runner/testdata/projects/opentelemetry-go"]
path = go-runner/testdata/projects/opentelemetry-go
url = https://github.com/open-telemetry/opentelemetry-go
[submodule "go-runner/testdata/projects/golang-benchmarks"]
path = go-runner/testdata/projects/golang-benchmarks
url = https://github.com/SimonWaldherr/golang-benchmarks
[submodule "go-runner/testdata/projects/fuego"]
path = go-runner/testdata/projects/fuego
url = https://github.com/go-fuego/fuego
[submodule "go-runner/testdata/projects/hugo"]
path = go-runner/testdata/projects/hugo
url = https://github.com/gohugoio/hugo/
[submodule "go-runner/testdata/projects/zerolog"]
path = go-runner/testdata/projects/zerolog
url = https://github.com/rs/zerolog
[submodule "go-runner/testdata/projects/zap"]
path = go-runner/testdata/projects/zap
url = https://github.com/uber-go/zap
[submodule "go-runner/testdata/projects/cli-runtime"]
path = go-runner/testdata/projects/cli-runtime
url = https://github.com/kubernetes/cli-runtime
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
exclude: ^go-runner/testdata/
- id: check-merge-conflict
- id: check-added-large-files

Expand All @@ -14,3 +15,31 @@ repos:
hooks:
- id: go-mod-tidy
- id: go-fmt
exclude: ^go-runner/src/builder/template\.go$

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
args: [--all, --]
files: ^go-runner/
pass_filenames: false
additional_dependencies: []
entry: bash -c 'cd go-runner && cargo fmt --all'
language: system

- id: cargo-check
args: [--all-targets]
files: ^go-runner/
pass_filenames: false
additional_dependencies: []
entry: bash -c 'cd go-runner && cargo check --all-targets'
language: system

- id: clippy
args: [--all-targets, --, -D, warnings]
files: ^go-runner/
pass_filenames: false
additional_dependencies: []
entry: bash -c 'cd go-runner && cargo clippy --all-targets -- -D warnings'
language: system
3 changes: 3 additions & 0 deletions go-runner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build-*/
target/
.codspeed
Loading
Loading