-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add distgen check to CI tests (#485)
It will be ran with the pull request tests. It will fail the testsuite before running actual tests if the content was not regenerated properly in the PR.
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,52 @@ on: | |
types: | ||
- created | ||
jobs: | ||
distgen-check: | ||
name: "Check distgen generated files" | ||
runs-on: ubuntu-20.04 | ||
if: | | ||
github.event.issue.pull_request | ||
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) | ||
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: "refs/pull/${{ github.event.issue.number }}/head" | ||
submodules: true | ||
|
||
- name: Check distgen generated files | ||
id: check | ||
shell: bash | ||
run: | | ||
sha=$(git rev-parse HEAD) | ||
sudo apt update && sudo apt -y install python3-pip | ||
pip3 install distgen | ||
result="success" | ||
./common/tests/check_distgen_generated_files.sh || result="failure" | ||
echo "result=$result" >> "$GITHUB_OUTPUT" | ||
echo "sha=$sha" >> "$GITHUB_OUTPUT" | ||
- name: Set final commit status | ||
uses: myrotvorets/[email protected] | ||
with: | ||
status: ${{ steps.check.outputs.result }} | ||
context: "Distgen check" | ||
sha: ${{ steps.check.outputs.sha }} | ||
|
||
- name: Exit on ERR | ||
shell: bash | ||
run: | | ||
_result=${{ steps.check.outputs.result }} | ||
if [ "$_result" == failure ]; then | ||
echo "Distgen-generated files are not regenerated properly." | ||
echo "Please regenerate them with:" | ||
echo "'make clean-versions'" | ||
echo "'make generate-all'" | ||
exit 1 | ||
fi | ||
container-tests: | ||
needs: distgen-check | ||
# This job only runs for '[test]' pull request comments by owner, member | ||
runs-on: ubuntu-20.04 | ||
name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}" | ||
|
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