-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: metrics generation workflow #1481
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
Merged
kakkoyun
merged 9 commits into
prometheus:main
from
SachinSahu431:metrics-generation-workflow
Apr 4, 2024
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
16e7165
Scripts to check new Go version
SachinSahu431 a9a181b
Changes to test workflow
SachinSahu431 eea5b78
Update workflow to run based on Go release cycle
SachinSahu431 a5e2b20
Revert deleted files for testing workflow
SachinSahu431 d08d514
Revert deleted file for testing workflow
SachinSahu431 db9e1c1
Fix linting issue
SachinSahu431 1a54900
Update cron schedule to per month
SachinSahu431 74a9e0b
Update bash file
SachinSahu431 4fec0a5
Keep latest 3 Go versions in supported_go_versions
SachinSahu431 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,38 @@ | ||
| --- | ||
| name: Weekly Go Version Check and Metric Generation | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 0 * * 0" # Every Sunday at midnight UTC | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| update-go-versions: | ||
| name: Update Go Versions and Generate Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Execute bash script | ||
| run: bash check-go-version.bash | ||
|
|
||
| - name: Commit and push changes | ||
| run: | | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "GitHub Action" | ||
| git add . | ||
| git commit -m "Update Go Collector metrics for new Go versions" | ||
| git push | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: "Update Go Collector metrics for new Go versions" | ||
| title: "Update Go Collector metrics for new Go versions" | ||
| body: | | ||
| This pull request updates the list of supported Go versions and generates new Go Collector metrics | ||
| branch: "main" | ||
| base: "main" | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| 1.22 | ||
| 1.21 | ||
| 1.20 | ||
| 1.20 | ||
| 1.19 |
This file contains hidden or 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,21 @@ | ||
| #!/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| get_latest_versions() { | ||
| curl -s https://go.dev/VERSION?m=text | sed -E -n 's/go([0-9]+\.[0-9]+|\.[0-9]+).*/\1/p' | ||
| } | ||
|
|
||
| current_version=$(cat supported_go_versions.txt | head -n 1) | ||
| latest_version=$(get_latest_versions) | ||
|
|
||
| # Check for new version of Go, and generate go collector test files | ||
| # New Go version gets appended at top of supported_go_versions.txt, and only top 3 versions are supported | ||
| if [[ ! $current_version =~ $latest_version ]]; then | ||
| echo "New Go version available: $latest_version" | ||
| echo "Updating supported_go_versions.txt and generating Go Collector test files" | ||
| sed -i "1i $latest_version" supported_go_versions.txt | ||
| make generate-go-collector-test-files | ||
| else | ||
| echo "No new Go version detected. Current Go version is: $current_version" | ||
| fi | ||
SachinSahu431 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.