forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
129 changed files
with
3,404 additions
and
2,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Report Coverage' | ||
description: 'Processes and uploads coverage reports from Go tests' | ||
|
||
inputs: | ||
unit-cov-path: | ||
description: 'Path to unit test coverage file' | ||
required: true | ||
integration-cov-path: | ||
description: 'Path to integration test coverage file' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Join coverage outputs | ||
shell: bash | ||
run: | | ||
cp ${{ inputs.unit-cov-path }} backend.cov | ||
tail -n+2 ${{ inputs.integration-cov-path }} >> backend.cov | ||
- name: Convert coverage info to per-func stats | ||
shell: bash | ||
run: go tool cover -func backend.cov > backend-funcs.log | ||
|
||
- name: Convert coverage info to HTML | ||
shell: bash | ||
run: go tool cover -html backend.cov -o backend.html | ||
|
||
- name: Upload coverage file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: backend-cov | ||
path: | | ||
backend.cov | ||
backend-funcs.log | ||
backend.html | ||
retention-days: 30 | ||
compression-level: 9 | ||
|
||
- name: Set summary to total coverage | ||
shell: bash | ||
run: | | ||
echo '# Coverage' >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
grep 'total:' backend-funcs.log | tr '\t' ' ' >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Run Backend Tests' | ||
description: 'Runs Grafana backend test suites' | ||
|
||
inputs: | ||
coverage-opts: | ||
description: 'Coverage options to pass to the test command (empty for no coverage)' | ||
required: false | ||
default: '' | ||
test-command: | ||
description: 'The test command to run' | ||
required: false | ||
default: 'make gen-go test-go-unit' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
if [ -n "${{ inputs.coverage-opts }}" ]; then | ||
COVER_OPTS="${{ inputs.coverage-opts }}" ${{ inputs.test-command }} | ||
else | ||
${{ inputs.test-command }} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'Setup Grafana Enterprise' | ||
description: 'Clones and sets up Grafana Enterprise repository for testing' | ||
|
||
inputs: | ||
github-app-name: | ||
description: 'Name of the GitHub App in Vault' | ||
required: false | ||
default: 'grafana-ci-bot' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Retrieve GitHub App secrets | ||
id: get-secrets | ||
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.0.1 | ||
with: | ||
repo_secrets: | | ||
APP_ID=${{ inputs.github-app-name }}:app-id | ||
APP_INSTALLATION_ID=${{ inputs.github-app-name }}:app-installation-id | ||
PRIVATE_KEY=${{ inputs.github-app-name }}:private-key | ||
- name: Generate GitHub App token | ||
id: generate_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ env.APP_ID }} | ||
private-key: ${{ env.PRIVATE_KEY }} | ||
repositories: "grafana-enterprise" | ||
owner: "grafana" | ||
|
||
- name: Setup Enterprise | ||
shell: bash | ||
env: | ||
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | ||
run: | | ||
git clone https://x-access-token:${GH_TOKEN}@github.com/grafana/grafana-enterprise.git ../grafana-enterprise; | ||
cd ../grafana-enterprise | ||
if git checkout ${GITHUB_HEAD_REF}; then | ||
echo "checked out ${GITHUB_HEAD_REF}" | ||
elif git checkout ${GITHUB_BASE_REF}; then | ||
echo "checked out ${GITHUB_BASE_REF}" | ||
else | ||
git checkout main | ||
fi | ||
./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.