Skip to content

Commit

Permalink
Run CLT tests from same branch by apply smart detection
Browse files Browse the repository at this point in the history
  • Loading branch information
donhardman committed Jan 23, 2025
1 parent 0bfc4a6 commit ee36496
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,51 @@ jobs:
docker push ${{ steps.vars.outputs.image_commit }}
docker rm -f temp
ref_detection:
name: Detect CLT tests ref
runs-on: ubuntu-22.04
outputs:
ref: ${{ steps.ref.outputs.ref }}
steps:
- name: Get current branch name
id: current_branch
run: |
BRANCH=${{ github.head_ref || github.ref_name }}
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
- name: Checkout manticoresearch repository
uses: actions/checkout@v4
with:
repository: manticoresoftware/manticoresearch
path: manticoresearch
fetch-depth: 0

- name: Check if branch exists in manticoresearch
id: check_branch
working-directory: manticoresearch
run: |
git ls-remote --heads origin ${{ steps.current_branch.outputs.branch }} | grep -q . && \
echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
- name: Detect ref
id: ref
run: |
set -e
if [[ "${{ steps.check_branch.outputs.exists }}" == "true" ]]; then
REF="${{ steps.current_branch.outputs.branch }}"
else
REF="master"
fi
echo "ref=${REF}" >> $GITHUB_OUTPUT
echo "Ref: ${REF}" >> $GITHUB_STEP_SUMMARY
clt:
name: Run CLT tests
needs: test_kit
needs: [test_kit, ref_detection]
uses: manticoresoftware/manticoresearch/.github/workflows/clt_tests.yml@master
with:
docker_image: ${{ needs.test_kit.outputs.docker_repo }}:${{ needs.test_kit.outputs.docker_tag }}
repository: manticoresoftware/manticoresearch
ref: master
ref: ${{ needs.ref_detection.outputs.ref }}

codestyle:
name: PHPCS validation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release
on:
push:
branches:
- main
- feature/buddy-clt-same-branch
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, labeled, unlabeled]
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Update deps
uses: manticoresoftware/manticoresearch/actions/update-deps@master
uses: manticoresoftware/manticoresearch/actions/update-deps@feature/buddy-clt-same-branch
with:
name: buddy
version: ${{ needs.vars.outputs.version_full }}
Expand Down

0 comments on commit ee36496

Please sign in to comment.