Skip to content
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

ci: add testing-docs nightly workflow #2351

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/testing-docs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Check testing docs nightly
on:
workflow_call:
pull_request:
merge_group:
push:
branches:
- main
- release/v*
- feat/*

jobs:
check-testing-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: tk/check-testing-docs-nightly

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: go.sum

- name: Generate testing docs for PR
run: make build-testing-docs

- name: Check for changes in integration tests documentation
id: check_changes_pr
continue-on-error: true
run: |
git show HEAD:scripts/test_doc/test_documentation.md > committed_file.md
cp scripts/test_doc/test_documentation.md generated_file.md
diff -q generated_file.md committed_file.md

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PRBOT_PAT }}
commit-message: "docs: update testing documentation"
title: "docs: update testing documentation"
branch: "bot/update-testing-docs"
body: |
This PR updates the testing documentation.
Please review the changes and merge if everything looks correct.




29 changes: 5 additions & 24 deletions .github/workflows/testing-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate testing docs
name: Check up-to-date testing docs

on:
workflow_call:
Expand All @@ -12,7 +12,6 @@ on:

permissions:
contents: write
pull-requests: write # 'write' access to pull requests in order to update test documentation automatically

jobs:
testing-docs:
Expand Down Expand Up @@ -40,31 +39,13 @@ jobs:
if: env.GIT_DIFF
run: make build-testing-docs

- name: Check for changes and update automatically
- name: Check for changes
if: env.GIT_DIFF
id: check_changes_and_update
id: check_changes
run: |
git show HEAD:scripts/test_doc/test_documentation.md > committed_file.md
cp scripts/test_doc/test_documentation.md generated_file.md
if ! diff -q generated_file.md committed_file.md; then
echo "Documentation for integration tests is out of date. Updating and pushing changes..."
cp generated_file.md scripts/test_doc/test_documentation.md

if [ -n "$GITHUB_HEAD_REF" ]; then
branch=$GITHUB_HEAD_REF
else
branch=${GITHUB_REF#refs/heads/}
fi

git fetch origin $branch
git checkout $branch

cp generated_file.md scripts/test_doc/test_documentation.md
git config user.name "github-actions"
git config user.email "[email protected]"
git add scripts/test_doc/test_documentation.md
git commit -m "Update testing documentation"

git push origin "$branch"

echo "Documentation for integration tests is out of date."
exit 1
fi
1 change: 1 addition & 0 deletions tests/integration/changeover.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
// * creates a transfer channel between the two chains
// * transitions the standalone chain to a consumer chain
// * confirms that no extra transfer channel is created, thus only one transfer channel and one CCV channel exist.
// test
func (suite *CCVTestSuite) TestRecycleTransferChannel() {
consumerKeeper := suite.consumerApp.GetConsumerKeeper()

Expand Down
Loading