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(github-actions): skip rc testing is no providers in this repo is changed #1248

Merged
merged 1 commit into from
Jul 19, 2023
Merged
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
49 changes: 37 additions & 12 deletions .github/workflows/test-rc-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,44 @@ jobs:
echo "rc_issue_url=$rc_issue_url"
echo "rc_issue_url=$rc_issue_url" >> $GITHUB_OUTPUT

- name: Update project dependencies to use RC providers
run: |
rc_issue_url="${{ steps.export-rc-issue-url.outputs.rc_issue_url }}"

echo "Updating setup.cfg with RC provider packages on $rc_issue_url"
python3 dev/integration_test_scripts/replace_dependencies.py --issue-url $rc_issue_url

- name: Check repo providers updated
id: check-repo-provideres-updated
run: |
difference=`git diff`
if [ -z "$difference" ]
then
echo "No provider changed"
echo "no_prvider_changed=true" >> $GITHUB_OUTPUT
else
echo "$difference"
fi

- name: Create RC branch
id: create_rc_branch
run: |
current_timestamp=`date +%Y-%m-%dT%H-%M-%S%Z`
echo "Current timestamp is" $current_timestamp
branch_name="rc-test-$current_timestamp"
git checkout -b $branch_name
if [ "${{ steps.check-repo-provideres-updated.outputs.no_prvider_changed }}" != "true" ]
then
current_timestamp=`date +%Y-%m-%dT%H-%M-%S%Z`
echo "Current timestamp is" $current_timestamp
branch_name="rc-test-$current_timestamp"
git checkout -b $branch_name

else
branch_name=""
fi
echo "rc_testing_branch=$branch_name"
echo "rc_testing_branch=$branch_name" >> $GITHUB_OUTPUT

- name: Update project dependencies to use RC providers
run: |
rc_issue_url="${{ steps.export-rc-issue-url.outputs.rc_issue_url }}"

echo "Updating setup.cfg with RC provider packages on $rc_issue_url"
python3 dev/integration_test_scripts/replace_dependencies.py --issue-url $rc_issue_url

- name: Commit changes and create a pull request
if: steps.create_rc_branch.outputs.rc_testing_branch != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -176,8 +195,14 @@ jobs:
needs: [validate-manual-input, create-branch-for-testing-rc-release]
if: |
always() &&
needs.create-branch-for-testing-rc-release.result == 'success' ||
(needs.validate-manual-input.result == 'success' && inputs.rc_testing_branch )
(
needs.create-branch-for-testing-rc-release.result == 'success' &&
needs.create-branch-for-testing-rc-release.outputs.rc_testing_branch != ''
) ||
(
needs.validate-manual-input.result == 'success' &&
inputs.rc_testing_branch
)
runs-on: 'ubuntu-20.04'
steps:
- name: export rc_testing_branch
Expand Down
Loading