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:
|
main:
|
||||||
runs-on: [self-hosted,FlipperZeroShell]
|
runs-on: [self-hosted,FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -171,13 +163,8 @@ jobs:
|
|||||||
if: ${{ !startsWith(github.ref, 'refs/tags') }}
|
if: ${{ !startsWith(github.ref, 'refs/tags') }}
|
||||||
runs-on: [self-hosted,FlipperZeroShell]
|
runs-on: [self-hosted,FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
if [ -d .git ]
|
|
||||||
then
|
|
||||||
git submodule status \
|
|
||||||
|| git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
uses: actions/checkout@v3
|
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:
|
lint_sources_check_submodules:
|
||||||
runs-on: [self-hosted,FlipperZeroShell]
|
runs-on: [self-hosted,FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
uses: actions/checkout@v3
|
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:
|
merge_report:
|
||||||
runs-on: [self-hosted,FlipperZeroShell]
|
runs-on: [self-hosted,FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
uses: actions/checkout@v3
|
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 }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
runs-on: [self-hosted, FlipperZeroShell]
|
runs-on: [self-hosted, FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
uses: actions/checkout@v3
|
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:
|
run_units_on_bench:
|
||||||
runs-on: [self-hosted, FlipperZeroUnitTest]
|
runs-on: [self-hosted, FlipperZeroUnitTest]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
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:
|
test_updater_on_bench:
|
||||||
runs-on: [self-hosted, FlipperZeroUpdaterTest]
|
runs-on: [self-hosted, FlipperZeroUpdaterTest]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
run: |
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
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: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -57,12 +49,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
|
echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Wipe workspace'
|
||||||
if: failure()
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
||||||
run: |
|
|
||||||
if [ -d .git ]; then
|
|
||||||
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: 'Checkout latest release'
|
- name: 'Checkout latest release'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
Loading…
Reference in New Issue
Block a user