Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[WIP] Fix cleanup cache (#190)
Browse files Browse the repository at this point in the history
* Fix cleanup cache

* echo github.env

* Cleanup always
  • Loading branch information
General-Beck authored Jul 16, 2020
1 parent fc22769 commit f2d29ce
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
echo "::set-env name=CARGO_TARGET_DIR::/cache/${{ github.head_ref }}/${{ matrix.toolchain }}"
- name: Cache checking
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'reopened'
continue-on-error: true
run: |
echo "Copy cache from master";
mkdir -p $CARGO_TARGET_DIR;
Expand Down Expand Up @@ -120,6 +121,17 @@ jobs:
path: artifacts/
## Cleanup stage
- name: Cleanup after merge pull request
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: rm -rf $CARGO_TARGET_DIR
if: always()
run: |
#debug
if ${{ github.event_name == 'pull_request' }} && ${{ github.event.action == 'closed' }} && ${{ github.event.pull_request.merged == true }}; then
echo "merged, cleaning";
rm -rf $CARGO_TARGET_DIR;
else
echo "nothing to do"
fi;
echo "github.event_name == " ${{ github.event_name }};
echo "github.event.action == " ${{ github.event.action }};
echo "github.event.pull_request.merged == " ${{ github.event.pull_request.merged }};
echo "github.ref == " ${{ github.ref }};
shell: bash

0 comments on commit f2d29ce

Please sign in to comment.