diff --git a/.github/actions/setup/directories/action.yml b/.github/actions/setup/directories/action.yml index e91787cc40..c56efb0987 100644 --- a/.github/actions/setup/directories/action.yml +++ b/.github/actions/setup/directories/action.yml @@ -49,6 +49,13 @@ inputs: default: '1' description: The depth of commit history fetched from the remote repository + clean: + required: false + type: boolean + default: '' + description: >- + If set to true, clean build directory. + outputs: {} # nothing? runs: @@ -147,9 +154,12 @@ runs: grep -F A.rb a.rb > /dev/null && set "${@:27}" echo files="$*" >> $GITHUB_OUTPUT - - if: steps.dummy-files.outcome == 'success' + - if: steps.dummy-files.outcome == 'success' || inputs.clean == 'true' uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0 with: - working-directory: ${{ inputs.builddir }} - post: - rm ${{ steps.dummy-files.outputs.files }} + working-directory: + post: | + cd ${{ inputs.builddir }} && rm ${{ steps.dummy-files.outputs.files }} + cd ${{ inputs.builddir }} && make distclean + find ${{ inputs.builddir }} -ls + [ "${{ inputs.builddir }}" = "${{ inputs.srcdir }}" ] || rmdir ${{ inputs.builddir }} diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index cb23375bab..46e1ac5e26 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -240,6 +240,7 @@ jobs: srcdir: src builddir: build makeup: true + clean: true - name: Run configure run: > diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a05c7cd439..e4aa733f6e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -67,6 +67,7 @@ jobs: srcdir: src builddir: build makeup: true + clean: true dummy-files: ${{ matrix.test_task == 'check' }} # Set fetch-depth: 0 so that Launchable can receive commits information. fetch-depth: 10 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5de657bf4b..4f9050a4c1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -79,6 +79,7 @@ jobs: srcdir: src builddir: build makeup: true + clean: true dummy-files: ${{ matrix.test_task == 'check' }} # Set fetch-depth: 10 so that Launchable can receive commits information. fetch-depth: 10