Fix the introduced bug where RO endpoint could've been accidentally u… #122
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
name: Test and release | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- "**/**.md" | |
- "**/**.yaml" | |
- "static/**" | |
branches: | |
- "main" | |
env: | |
GO_VERSION: ">=1.21" | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
shared: | |
uses: telegram-bot-app/ci-scripts/.github/workflows/build-test-publish-inject.yaml@main | |
with: | |
enable-code-scans: false | |
should-deploy: false | |
secrets: | |
ghcr-token: ${{ secrets.GHCR_TOKEN }} | |
test: | |
name: "Benchmarking the results" | |
needs: [shared] | |
runs-on: ubuntu-latest | |
container: golang:1 | |
# container: github/super-linter:v4 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{env.GO_VERSION}} | |
cache-dependency-path: "**/*.sum" | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install ca-certificates make -y | |
update-ca-certificates | |
go mod tidy | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Run benchmark | |
run: | | |
go test -bench=. -benchmem ./... -run=^# | tee output.txt | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: "go" | |
output-file-path: output.txt | |
fail-on-alert: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true | |
summary-always: true | |
# auto-push only if it's on main branch | |
auto-push: true | |
gh-pages-branch: "gh-pages" | |
benchmark-data-dir-path: "docs" |