Skip to content
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

CI related improvements #81

Merged
merged 6 commits into from
Aug 3, 2022
Merged

CI related improvements #81

merged 6 commits into from
Aug 3, 2022

Conversation

hrw
Copy link
Collaborator

@hrw hrw commented Aug 2, 2022

When we do builds on CI we may want to be able to define where build directory is (instead of ../build-*".

Another thing is location of download/ and ccache/ directories - GitHub Actions dislike paths with ".." in them. Moving those to checked out sources (where it was linked before) allows to make caches easier.

@hrw hrw requested review from smoser and osfrickler August 2, 2022 13:18
Copy link
Member

@smoser smoser left a comment

Choose a reason for hiding this comment

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

please quote all variables.

And lets use CI_BUILD to set OUT.

OUT="$PWD/../build-$VER"
if [ "$CI_BUILD" = "true" ]; then
    OUT=$WHERE_YOU_WANT_IT_FOR_CI"
fi

Last, check CI_BUILD lie BOOTTEST is checked. accepted values are empty, false or true.

CI_BUILD="${CI_BUILD:-false}"
case "$CI_BUILD" in
    true|false) echo "bad value '$CI_BUILD' for CI_BUILD"; exit 1;;
esac

bin/build-release Outdated Show resolved Hide resolved
@NucciTheBoss
Copy link
Contributor

Just to note, this might also just be specific to me, but I did not have any issues with using .. in my original action. The actions/checkout@v3 changes the current working directory in the pipeline to the CirrOS source code. However, syntactically/readability speaking, I think the way it is done here will be better for the pipeline.

That being said, I think this pull request should also update .gitignore to include ccache and build-*. That way if someone is building locally and committing upstream, no files from these directories will end up polluting the commit and require rebasing their branch/fork to remove. Let me know what you think.

@hrw
Copy link
Collaborator Author

hrw commented Aug 2, 2022

That being said, I think this pull request should also update .gitignore to include ccache and build-*. That way if someone is building locally and committing upstream, no files from these directories will end up polluting the commit and require rebasing their branch/fork to remove. Let me know what you think.

#83 does that

By default those two directories are created in parent directory. Which
makes telling Github Actions which dirs to cache harder.

Change-Id: I582d24d5993ca4739cebd3c38f45a5df76cded47
.github/workflows/build-cirros.yaml Outdated Show resolved Hide resolved
bin/build-release Show resolved Hide resolved
hrw added 4 commits August 3, 2022 09:20
fetching sources copied some files into wrong place
On CI we may want to tell where exactly build dir we want to be.
GitHub Actions for example dislike paths with ".." in them.

CI_BUILD_OUT gets $PWD added in build-release script.

(taken from patch done by Dr. Jens Harbott)

Change-Id: I73ce170f12ca035893b810c2314bd0aa429c4f5b
@hrw
Copy link
Collaborator Author

hrw commented Aug 3, 2022

build works, artifacts upload works, cache is reused

@hrw hrw merged commit 7f5471e into cirros-dev:master Aug 3, 2022
@hrw hrw deleted the 2022/ci-improvements branch August 3, 2022 09:06
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.

None yet

4 participants