Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
carles-grafana committed Jan 3, 2025
1 parent f25ccb1 commit 79245ff
Showing 1 changed file with 38 additions and 166 deletions.
204 changes: 38 additions & 166 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,178 +17,50 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
name: Lint
release:
if: github.repository == 'grafana/tempo' # skip in forks
runs-on: ubuntu-24.04
steps:

- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: check-fmt
run: make check-fmt

- name: check-jsonnetfmt
run: make check-jsonnetfmt

- name: Get year and week number
id: get-year-week-number
run: echo "date=$(date +"%Yweek%U")" >> $GITHUB_OUTPUT

- name: cache golangci
uses: actions/cache@v4
with:
path: .cache/golangci-lint
key: golangci-lint-${{ runner.os }}-${{ steps.get-year-week-number.outputs.date }}-${{ hashFiles('go.mod', '.golangci.yml') }}

- name: lint
run: |
make lint base=origin/${{github.base_ref}}
sudo chown -R $(id -u):$(id -g) .cache/golangci-lint # needed to archive cache
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-24.04
strategy:
matrix:
test-target:
[
test-with-cover-pkg,
test-with-cover-tempodb,
test-with-cover-tempodb-wal,
test-with-cover-others,
]

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Run Tests
run: make ${{ matrix.test-target }}

integration-tests:
name: Run integration tests
runs-on: ubuntu-24.04
strategy:
matrix:
test-target:
[
test-e2e,
test-integration-poller,
test-e2e-deployments,
test-e2e-serverless,
]

steps:
- name: Check out code
uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run Tests
run: make ${{ matrix.test-target }}

build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Build Tempo
run: make tempo

- name: generate-manifest
run: make generate-manifest

- name: Build tempo-query
run: make tempo-query

- name: Build vulture
run: make tempo-vulture

- name: Build tempo-cli
run: make tempo-cli

benchmark:
name: Benchmark
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Bench
run: make test-bench

vendor-check:
name: Vendor check
runs-on: ubuntu-24.04
steps:
- name: Check out code
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: fetch tags
- run: git fetch --tags

- name: Check vendor
run: make vendor-check

tempo-jsonnet:
name: Check jsonnet & tempo-mixin
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- id: "get-secrets"
name: "get nfpm signing keys"
uses: "grafana/shared-workflows/actions/get-vault-secrets@main"
with:
go-version-file: "go.mod"

- name: Check jsonnet
run: make jsonnet-check
common_secrets: |
NFPM_SIGNING_KEY=packages-gpg:private-key
NFPM_DEFAULT_PASSPHRASE=packages-gpg:passphrase
- name: Check tempo-mixin
run: make tempo-mixin-check
- name: write-key
run: printf "%s" "$NFPM_SIGNING_KEY" > $NFPM_SIGNING_KEY_FILE
env:
NFPM_SIGNING_KEY_FILE: /tmp/nfpm-private-key.key

- name: Test jsonnet
run: make jsonnet-test
- name: test release
run: make release-snapshot

build-technical-documentation:
name: Build technical documentation
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build Website
run: docker run -v ${PWD}/docs/sources:/hugo/content/docs/tempo/latest --rm grafana/docs-base:latest make prod
- name: test deb package
run: |
docker run --name debcontainer -it --detach jrei/systemd-debian:12 /bin/sh
docker cp ./dist/tempo*_amd64.deb debcontainer:.
docker cp ./tools/packaging/wait-for-ready.sh debcontainer:.
docker exec debcontainer dpkg -i ./tempo*_amd64.deb
docker exec debcontainer [ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
docker exec debcontainer apt update && apt install -y curl
docker exec debcontainer ./wait-for-ready.sh)
- name: test rpm package
run: |
docker run --name rpmcontainer -it --detach jrei/systemd-centos:8 /bin/sh
docker cp ./dist/tempo*_amd64.rpm rpmcontainer:.
docker cp ./tools/packaging/wait-for-ready.sh rpmcontainer:.
docker exec rpmcontainer rpm --import https://packages.grafana.com/gpg.key
docker exec rpmcontainer rpm -i ./tempo*_amd64.rpm
docker exec rpmcontainer [ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
docker exec rpmcontainer apt update && apt install -y curl
docker exec rpmcontainer ./wait-for-ready.sh)

0 comments on commit 79245ff

Please sign in to comment.