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

.github/workflows: verify that each commit builds for test suite changes #16556

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/lint-build-commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
PR_PARENT_SHA=$(git rev-parse "${PR_FIRST_SHA}^")
git rebase --exec "make build -j $(nproc)" $PR_PARENT_SHA

- name: Check code changes
- name: Check bpf code changes
uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: bpf-tree
with:
Expand All @@ -78,6 +78,26 @@ jobs:
PR_PARENT_SHA=$(git rev-parse "${PR_FIRST_SHA}^")
git rebase --exec "make -C bpf build_all -j $(nproc)" $PR_PARENT_SHA

- name: Check test code changes
uses: dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
id: test-tree
with:
filters: |
src:
- 'test/**'

# Runs only if code under test/ is changed.
- name: Check if ginkgo test suite build works for every commit
if: steps.test-tree.outputs.src == 'true'
run: |
PR_COMMITS_API_JSON=$(curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${{ github.event.pull_request.commits_url }})
PR_FIRST_SHA=$(echo "$PR_COMMITS_API_JSON" | jq -r ".[0].sha")
PR_PARENT_SHA=$(git rev-parse "${PR_FIRST_SHA}^")
git rebase --exec "make -C test build -j $(nproc)" $PR_PARENT_SHA

- name: Failed commit during the build
if: ${{ failure() }}
run: git --no-pager log --format=%B -n 1
Expand Down