Github: wipe workspace before checkout (#2527)
* Github: wipe workspace before checkout * Github: allow find to fail * Github: limit maxdepth for find
This commit is contained in:
parent
acc32f66e8
commit
973287b09b
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -18,16 +18,8 @@ jobs:
|
||||
main:
|
||||
runs-on: [self-hosted,FlipperZeroShell]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@v3
|
||||
@ -171,13 +163,8 @@ jobs:
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags') }}
|
||||
runs-on: [self-hosted,FlipperZeroShell]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]
|
||||
then
|
||||
git submodule status \
|
||||
|| git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@v3
|
||||
|
12
.github/workflows/lint_and_submodule_check.yml
vendored
12
.github/workflows/lint_and_submodule_check.yml
vendored
@ -18,16 +18,8 @@ jobs:
|
||||
lint_sources_check_submodules:
|
||||
runs-on: [self-hosted,FlipperZeroShell]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@v3
|
||||
|
12
.github/workflows/merge_report.yml
vendored
12
.github/workflows/merge_report.yml
vendored
@ -12,16 +12,8 @@ jobs:
|
||||
merge_report:
|
||||
runs-on: [self-hosted,FlipperZeroShell]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@v3
|
||||
|
12
.github/workflows/pvs_studio.yml
vendored
12
.github/workflows/pvs_studio.yml
vendored
@ -19,16 +19,8 @@ jobs:
|
||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||
runs-on: [self-hosted, FlipperZeroShell]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@v3
|
||||
|
12
.github/workflows/unit_tests.yml
vendored
12
.github/workflows/unit_tests.yml
vendored
@ -12,16 +12,8 @@ jobs:
|
||||
run_units_on_bench:
|
||||
runs-on: [self-hosted, FlipperZeroUnitTest]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
20
.github/workflows/updater_test.yml
vendored
20
.github/workflows/updater_test.yml
vendored
@ -12,16 +12,8 @@ jobs:
|
||||
test_updater_on_bench:
|
||||
runs-on: [self-hosted, FlipperZeroUpdaterTest]
|
||||
steps:
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || (
|
||||
git ls-files --stage | egrep '^160000' | awk '{print $4}' | while read submodule
|
||||
do
|
||||
git rm -rf "$submodule"
|
||||
done
|
||||
)
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
@ -57,12 +49,8 @@ jobs:
|
||||
run: |
|
||||
echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 'Decontaminate previous build leftovers'
|
||||
if: failure()
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||
fi
|
||||
- name: 'Wipe workspace'
|
||||
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||
|
||||
- name: 'Checkout latest release'
|
||||
uses: actions/checkout@v3
|
||||
|
Loading…
Reference in New Issue
Block a user