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

[SOFT-438] Cache packages in CI #313

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7c9bca7
initial commit
kevineslee56 Mar 14, 2021
7953f8c
more cache steps, removed duplicate line, updated readme
kevineslee56 Mar 18, 2021
ad66a51
individualized if statements into steps, updated installation paths, …
kevineslee56 Mar 20, 2021
a7ffe57
added missing run statements and changed their formatting
kevineslee56 Mar 20, 2021
c381297
updated cache dir for arm
kevineslee56 Mar 26, 2021
1761e2e
added mkdir
kevineslee56 Mar 26, 2021
375324c
trying out mkdir again
kevineslee56 Mar 26, 2021
dcee980
changed cache to v1
kevineslee56 Mar 27, 2021
4429f14
changed the id revision to key
kevineslee56 Mar 27, 2021
88a1d4c
replaced ~ with /home/runner, removed force step
kevineslee56 Mar 30, 2021
520e6e1
forgot to change ~ to home for installation
kevineslee56 Mar 30, 2021
00e2721
trying out homerunner for pip
kevineslee56 Mar 30, 2021
7da46e8
renamed arm cache and formatted
kevineslee56 Mar 30, 2021
4c7b30e
trying out new cache paths
kevineslee56 Apr 1, 2021
32c20fd
changed libc6 path
kevineslee56 Apr 2, 2021
73a54ce
checking if deb solves test_barrier
kevineslee56 Apr 2, 2021
623178e
trying out lintian
kevineslee56 Apr 2, 2021
866d39d
trying out /usr/bin/make
kevineslee56 Apr 2, 2021
d95c21b
trying out dpkg for gcc
kevineslee56 May 20, 2021
6b3e7cb
trying out dpkg for gcc
kevineslee56 May 20, 2021
47e2309
Merge branch 'master' into soft_438_cache_packages
meganpark01 Jul 18, 2021
d2c6812
Removed files that were committed by accident
meganpark01 Jul 18, 2021
2ce2d4c
Fixed indentation issues
meganpark01 Jul 18, 2021
73b5756
Removed duplicated line
meganpark01 Jul 18, 2021
bde17f8
Removed dpkg to test clang installation
meganpark01 Jul 18, 2021
ffed2f5
Removed dpkg for other apt-get dependencies
meganpark01 Jul 18, 2021
4b438d8
Changed path of clang, clang-format
meganpark01 Jul 18, 2021
9aa1e06
Changed paths back to original
meganpark01 Jul 18, 2021
5b0368c
Removed dpkg for gcc to test
meganpark01 Jul 18, 2021
f5a50d2
Changed directory for printing arm
meganpark01 Jul 19, 2021
6003666
Changed directory syntax for printing arm
meganpark01 Jul 19, 2021
1078b51
Removed changes from last commit
meganpark01 Jul 19, 2021
d8d2bf5
Added arm to PATH
meganpark01 Jul 20, 2021
1b1542f
Removed directory for arm installation
meganpark01 Jul 20, 2021
79daa63
Added pip cache directory to PATH
meganpark01 Jul 21, 2021
d051119
Removed caching for gcc to test
meganpark01 Jul 21, 2021
a46518c
Changed gcc path
meganpark01 Jul 21, 2021
1771bd4
Removed caching for vcan to test
meganpark01 Jul 21, 2021
92ba423
Changed vcan path
meganpark01 Jul 21, 2021
d36860e
testing path
meganpark01 Jul 22, 2021
5be91db
Updated arm path
meganpark01 Jul 22, 2021
24a03fb
Updated pip directory
meganpark01 Jul 22, 2021
09be768
Testing new path and key for pip
meganpark01 Jul 22, 2021
8cd2c15
Testing pip path
meganpark01 Jul 22, 2021
7d6ef77
Changed pip path
meganpark01 Jul 22, 2021
e1ce52c
Testing dpkg for gcc
meganpark01 Jul 23, 2021
56a55d0
Changed dependencies for gcc installation
meganpark01 Jul 23, 2021
33da8da
Fixed syntax error
meganpark01 Jul 23, 2021
0036a3a
Changed arm path
meganpark01 Jul 25, 2021
35b5dbb
Testing gcc path
meganpark01 Jul 25, 2021
14a3000
Changed gcc path
meganpark01 Jul 25, 2021
09a3700
Testing if adding gcc cache dir to path works
meganpark01 Jul 25, 2021
bb5ee01
Removed previous gcc changes, added step to update PATH
meganpark01 Jul 26, 2021
b372adf
Testing gcc path
meganpark01 Jul 26, 2021
485fef3
Changed gcc path again
meganpark01 Jul 26, 2021
ea5faf6
Changed gcc path..
meganpark01 Jul 26, 2021
396d46c
Changed gcc path
meganpark01 Jul 26, 2021
7e12b85
Changed gcc path..
meganpark01 Jul 26, 2021
4656703
Removed unneeded commented out code and changed gcc path
meganpark01 Jul 27, 2021
9a93944
Changed gcc path
meganpark01 Jul 27, 2021
6623b33
test commit
YiJie-Zhu Sep 16, 2021
2777284
[SOFT-438] Merged master
YiJie-Zhu Sep 28, 2021
2b5fd38
[SOFT-438] Merged master
YiJie-Zhu Sep 28, 2021
8bc554f
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
7126ea8
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
b43e463
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
06e3b88
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
d696c69
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
c0ad42b
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
9f823a0
[SOFT-438] test
YiJie-Zhu Sep 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Copy link
Collaborator

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:

path: |
  ~/foo
  ~/bar

Then the key should be created by concatenating the os (${{ runner.os }}), the name of the thing you're caching, and then hashFiles on any files that determine whether the cache should be invalidated. I.e., for pip, any requirements.txt files in the repo could change what dependencies get installed, so we call hashFiles on all the requirements.txt files.


- 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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}"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a newline at the end of the file!