Skip to content

Better cleanup strategy for GH Actions CI #8618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

anatoliykmetyuk
Copy link
Contributor

Before each GH Actions job, remove everything from:

  • The working directory (where the Dotty repo is cloned)
  • The temp directory
  • The user home directory

These directories are mounted by Docker before the workflow
is started and hence can be persisted between different CI
runs and we don't want that. The list of the directories can be obtained by looking at the docker create command
that the "Initialize containers" step runs for each job of
the CI. Only volumes that are vital for CI functioning are
spared during the cleanup.

Before each GH Actions job, remove everything from:

- The working directory (where the Dotty repo is cloned)
- The temp directory
- The user home directory

These directories are mounted by Docker before the workflow
is started and hence can be persisted between different CI
runs and we don't want that. The list of the directories can be obtained by looking at the `docker create` command
that the "Initialize containers" step runs for each job of
the CI. Only volumes that are vital for CI functioning are
spared during the cleanup.
@anatoliykmetyuk anatoliykmetyuk self-assigned this Mar 26, 2020
Comment on lines +109 to +110
cd $folder
rm -rf ..?* .[!.]* *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
cd $folder
rm -rf ..?* .[!.]* *
rm -rf $folder
mkdir $folder

Copy link
Contributor Author

@anatoliykmetyuk anatoliykmetyuk Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original version works well enough: it cleans up both hidden and non-hidden files. The problem with deleting the folders is that if they are mounted by Docker, we might get the "device is busy" error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably factor this out in a script

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's tricky with the current setup. CIs are surprisingly bad at modularisation, neither Drone nor GH Actions doesn't allow to save steps under a name and then refer to them later. I'll merge this FTTB since this is quite high prio.

@anatoliykmetyuk anatoliykmetyuk merged commit 703fda0 into scala:master Mar 26, 2020
@anatoliykmetyuk anatoliykmetyuk deleted the ci-cleanup branch March 26, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants