-
Notifications
You must be signed in to change notification settings - Fork 3
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
[SOFT-438] Cache packages in CI #313
Open
kevineslee56
wants to merge
70
commits into
master
Choose a base branch
from
soft_438_cache_packages
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
7c9bca7
initial commit
kevineslee56 7953f8c
more cache steps, removed duplicate line, updated readme
kevineslee56 ad66a51
individualized if statements into steps, updated installation paths, …
kevineslee56 a7ffe57
added missing run statements and changed their formatting
kevineslee56 c381297
updated cache dir for arm
kevineslee56 1761e2e
added mkdir
kevineslee56 375324c
trying out mkdir again
kevineslee56 dcee980
changed cache to v1
kevineslee56 4429f14
changed the id revision to key
kevineslee56 88a1d4c
replaced ~ with /home/runner, removed force step
kevineslee56 520e6e1
forgot to change ~ to home for installation
kevineslee56 00e2721
trying out homerunner for pip
kevineslee56 7da46e8
renamed arm cache and formatted
kevineslee56 4c7b30e
trying out new cache paths
kevineslee56 32c20fd
changed libc6 path
kevineslee56 73a54ce
checking if deb solves test_barrier
kevineslee56 623178e
trying out lintian
kevineslee56 866d39d
trying out /usr/bin/make
kevineslee56 d95c21b
trying out dpkg for gcc
kevineslee56 6b3e7cb
trying out dpkg for gcc
kevineslee56 47e2309
Merge branch 'master' into soft_438_cache_packages
meganpark01 d2c6812
Removed files that were committed by accident
meganpark01 2ce2d4c
Fixed indentation issues
meganpark01 73b5756
Removed duplicated line
meganpark01 bde17f8
Removed dpkg to test clang installation
meganpark01 ffed2f5
Removed dpkg for other apt-get dependencies
meganpark01 4b438d8
Changed path of clang, clang-format
meganpark01 9aa1e06
Changed paths back to original
meganpark01 5b0368c
Removed dpkg for gcc to test
meganpark01 f5a50d2
Changed directory for printing arm
meganpark01 6003666
Changed directory syntax for printing arm
meganpark01 1078b51
Removed changes from last commit
meganpark01 d8d2bf5
Added arm to PATH
meganpark01 1b1542f
Removed directory for arm installation
meganpark01 79daa63
Added pip cache directory to PATH
meganpark01 d051119
Removed caching for gcc to test
meganpark01 a46518c
Changed gcc path
meganpark01 1771bd4
Removed caching for vcan to test
meganpark01 92ba423
Changed vcan path
meganpark01 d36860e
testing path
meganpark01 5be91db
Updated arm path
meganpark01 24a03fb
Updated pip directory
meganpark01 09be768
Testing new path and key for pip
meganpark01 8cd2c15
Testing pip path
meganpark01 7d6ef77
Changed pip path
meganpark01 e1ce52c
Testing dpkg for gcc
meganpark01 56a55d0
Changed dependencies for gcc installation
meganpark01 33da8da
Fixed syntax error
meganpark01 0036a3a
Changed arm path
meganpark01 35b5dbb
Testing gcc path
meganpark01 14a3000
Changed gcc path
meganpark01 09a3700
Testing if adding gcc cache dir to path works
meganpark01 bb5ee01
Removed previous gcc changes, added step to update PATH
meganpark01 b372adf
Testing gcc path
meganpark01 485fef3
Changed gcc path again
meganpark01 ea5faf6
Changed gcc path..
meganpark01 396d46c
Changed gcc path
meganpark01 7e12b85
Changed gcc path..
meganpark01 4656703
Removed unneeded commented out code and changed gcc path
meganpark01 9a93944
Changed gcc path
meganpark01 6623b33
test commit
YiJie-Zhu 2777284
[SOFT-438] Merged master
YiJie-Zhu 2b5fd38
[SOFT-438] Merged master
YiJie-Zhu 8bc554f
[SOFT-438] test
YiJie-Zhu 7126ea8
[SOFT-438] test
YiJie-Zhu b43e463
[SOFT-438] test
YiJie-Zhu 06e3b88
[SOFT-438] test
YiJie-Zhu d696c69
[SOFT-438] test
YiJie-Zhu c0ad42b
[SOFT-438] test
YiJie-Zhu 9f823a0
[SOFT-438] test
YiJie-Zhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,16 +19,21 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# TODO: cache all the setup | ||
|
||
- name: Setup directories | ||
run: | | ||
# create directory that will be on the PATH | ||
mkdir -p ~/.local/bin | ||
echo "${HOME}/.local/bin" >> $GITHUB_PATH | ||
mkdir -p ~/source | ||
|
||
- uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
|
||
- name: Install gcc, clang, clang-format | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | ||
sudo apt-get update | ||
|
@@ -51,6 +56,7 @@ jobs: | |
MAKE_PATH: make-4.1 | ||
MAKE_ARCHIVE_PATH: make-4.1.tar.gz | ||
MAKE_URL: http://ftp.gnu.org/gnu/make/make-4.1.tar.gz | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
wget -nv $MAKE_URL | ||
tar xvf $MAKE_ARCHIVE_PATH | ||
|
@@ -66,6 +72,7 @@ jobs: | |
python-version: '3.x' | ||
|
||
- name: Install Python tooling | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
pip install --user pylint | ||
pip install --user autopep8 | ||
|
@@ -90,17 +97,34 @@ jobs: | |
pylint --version | ||
autopep8 --version | ||
|
||
- name: Format and lint | ||
- name: Format | ||
run: | | ||
make test_format | ||
|
||
- name: Lint | ||
make lint | ||
|
||
- name: Pylint | ||
make pylint | ||
|
||
- name: Build and test | ||
- name: Build stm32f0xx | ||
run: | | ||
make build_all PLATFORM=stm32f0xx DEFINES="${DEFINES}" | ||
make clean | ||
|
||
- name: Build x86 | ||
run: | | ||
make build_all PLATFORM=x86 DEFINE="${DEFINES}" | ||
make test_all PLATFORM=x86 DEFINE="${DEFINES}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line shouldn't be here eh? |
||
|
||
- name: Test x86 | ||
run: | | ||
make test_all PLATFORM=x86 DEFINE="${DEFINES}" | ||
|
||
- name: Pytest | ||
run: | | ||
make pytest_all | ||
make build_all PLATFORM=x86 COMPILER=clang DEFINE="${DEFINES}" | ||
|
||
- name: Build x86 with clang | ||
run: | | ||
make build_all PLATFORM=x86 COMPILER=clang DEFINE="${DEFINES}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a newline at the end of the file! |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only caches pip dependencies eh? You'll need to use a separate cache step with a separate id for each step you want to skip based on caching. The general rule as I see it is, whatever directories need to be cached go in
path
, optionally line break separated if there's multiple of them:Then the key should be created by concatenating the os (
${{ runner.os }}
), the name of the thing you're caching, and thenhashFiles
on any files that determine whether the cache should be invalidated. I.e., forpip
, any requirements.txt files in the repo could change what dependencies get installed, so we callhashFiles
on all the requirements.txt files.