Tests - Daily #1
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: Build - Daily Official Build | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
- manual-daily-build | |
schedule: | |
- cron: "0 9 * * *" | |
jobs: | |
build-release: | |
name: Daily Build Tests | |
# Only run this job if we're in the main repo, not a fork. | |
if: github.repository == 'deepgram/deepgram-go-sdk' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code by commit | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
id: go | |
- name: Config git | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_ACCESS_TOKEN }} | |
shell: bash | |
run: | | |
git config --global init.defaultBranch main | |
git config --global pull.rebase true | |
git config --global url."https://git:[email protected]".insteadOf "https://github.com" | |
- name: Get dependencies | |
shell: bash | |
run: | | |
make ensure-deps | |
- name: Get dependencies | |
shell: bash | |
run: | | |
BRANCH_NAME="response-shape-${{ github.run_id }}" | |
git checkout -b "$BRANCH_NAME" | |
# run daily tests | |
go test -v -run TestDaily_ ./... | |
# create a PR | |
git add -A ./tests/response_data | |
git commit -s -m "auto-generated - update Response Shapes" | |
git push origin "$BRANCH_NAME" | |
gh pr create --title "auto-generated - update API spec" --body "auto-generated - update API spec" --base "main" | |
sleep 30 | |
gh pr merge "$BRANCH_NAME" --delete-branch --squash --admin |