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:
あく 2023-03-22 20:26:40 +09:00 committed by GitHub
parent acc32f66e8
commit 973287b09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 73 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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