tests: refactor tests to ignore readme generation for Dockerfile changes

Ideally we can trigger a readme update on merge in the future. For now, this will work well.
This commit is contained in:
Jose Diaz-Gonzalez
2021-04-26 11:43:13 -04:00
parent bb7a6cc03d
commit 9b33948f94

View File

@@ -21,6 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.7.x'
@@ -30,6 +33,11 @@ jobs:
- run: sudo sysctl -w vm.max_map_count=262144
- run: |
git fetch -q origin master
changed=$(git --no-pager diff --name-only $GITHUB_SHA..origin/master)
if [ $changed = "Dockerfile" ]; then
echo "Please run 'make generate' to update the image version in the README.md"
else
make generate
if ! git diff --quiet README.md; then
echo "Please run 'make generate'"
@@ -37,6 +45,7 @@ jobs:
git --no-pager diff README.md
exit 1
fi
fi
- run: make test
@@ -56,6 +65,9 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.7.x'
@@ -65,13 +77,19 @@ jobs:
- run: sudo sysctl -w vm.max_map_count=262144
- run: |
git fetch -q origin master
changed=$(git --no-pager diff --name-only $GITHUB_SHA..origin/master)
if [ $changed = "Dockerfile" ]; then
echo "Please run 'make generate' to update the image version in the README.md"
else
make generate
if ! git diff --quiet README.md; then
echo "Please run `make generate`"
echo "Please run 'make generate'"
git status --short
git --no-pager diff README.md
exit 1
fi
fi
- run: make test