mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-07-30 11:24:40 +00:00
ci: Check if tree is clean before running other jobs
Run make format and check if the tree is still clean before running other CI jobs. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -16,6 +16,37 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "0 6 * * *"
|
- cron: "0 6 * * *"
|
||||||
jobs:
|
jobs:
|
||||||
|
check-tree-clean:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
cache: pip
|
||||||
|
|
||||||
|
- name: Install tox
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install tox
|
||||||
|
|
||||||
|
- name: Run make format
|
||||||
|
run: |
|
||||||
|
make format
|
||||||
|
|
||||||
|
- name: Check if tree is clean
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "There are uncommitted changes!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
@@ -55,6 +86,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
find . -type f -iname '*.sh' -exec shellcheck {} \;
|
find . -type f -iname '*.sh' -exec shellcheck {} \;
|
||||||
working-directory: ${{ env.collection_dir }}
|
working-directory: ${{ env.collection_dir }}
|
||||||
|
needs:
|
||||||
|
- check-tree-clean
|
||||||
|
|
||||||
sanity:
|
sanity:
|
||||||
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
|
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
|
||||||
|
|||||||
Reference in New Issue
Block a user