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 e9512ae4d5
commit b794db26f8

View File

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