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 all commits
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
138 changes: 116 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

on:
# Run on all pull requests and all pushes to master
#Run on all pull requests and all pushes to master
push:
branches: [ master ]
pull_request:
Expand All @@ -20,28 +20,114 @@ 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-gcc
with:
path: ~/gcc
key: ${{ runner.os }}-gcc

- uses: actions/cache@v2
id: cache-clang
with:
path: /usr/lib/llvm-5.0/bin/clang
key: ${{ runner.os }}-clang

- uses: actions/cache@v2
id: cache-clang-format
with:
path: /usr/bin/clang-format-5.0
key: ${{ runner.os }}-clang-format

- uses: actions/cache@v2
id: cache-libc6-i386
with:
path: /var/lib/dpkg/info/libc6-i386
key: ${{ runner.os }}-libc6-i386

- uses: actions/cache@v2
id: cache-linux-module
with:
path: /var/lib/dpkg/info/linux-modules-extra-4.15.0-20-generic
key: ${{ runner.os }}-linux-module

- name: Install gcc, clang, clang-format
- uses: actions/cache@v2
id: cache-make
with:
path: /usr/bin/make
key: ${{ runner.os }}-make

- uses: actions/cache@v2
id: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
#path: $HOME/.cache/pip

- uses: actions/cache@v2
id: cache-arm-v1
with:
path: $HOME/.arm-none-eabi-gcc-cache
key: ${{ runner.os }}-arm-v1

- name: Add repo and update
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-fast -y install gcc-6
sudo apt-fast -y install clang-5.0
sudo apt-fast -y install clang-format-5.0
sudo apt-fast -y install libc6-i386
# for vcan module
sudo apt-fast -y install linux-modules-extra-$(uname -r)

- name: Install gcc
if: steps.cache-gcc.outputs.cache-hit != 'true'
run: sudo apt-fast -y install gcc-6

# - name: Install gcc
# env:
# CACHE_HIT: ${{steps.cache-gcc.outputs.cache-hit}}
# run: |
# if [[ "$CACHE_HIT" == 'true' ]]; then
# sudo cp --force --recursive ~/gcc/* /
# else
# sudo apt-fast -y install gcc-6
# sudo dpkg -L gcc-6 | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/gcc/
# for dep in cpp-6 gcc-6-base gcc-8-base libasan3 libgcc-6-dev libmpx2; do
# dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/gcc/
# done
# fi

- name: Install clang
if: steps.cache-clang.outputs.cache-hit != 'true'
run: sudo apt-fast -y install clang-5.0

- name: Install clang-format
if: steps.cache-clang-format.outputs.cache-hit != 'true'
run: sudo apt-fast -y install clang-format-5.0

- name: Install libc6-i386
if: steps.cache-libc6-i386.outputs.cache-hit != 'true'
run: sudo apt-fast -y install libc6-i386

# for vcan module
- name: Install linux modules
if: steps.cache-linux-module.outputs.cache-hit != 'true'
run: sudo apt-fast -y install linux-modules-extra-$(uname -r)

- name: Which gcc, clang, clang-format
run: |
ln -sf `which gcc-6` ~/.local/bin/gcc
ln -sf `which clang-5.0` ~/.local/bin/clang
ln -sf `which clang-format-5.0` ~/.local/bin/clang-format

- name: Make arm cache directory
#run:
#mkdir -p /home/runner/.arm-none-eabi-gcc-cache
run: |
mkdir -p ~/.arm-none-eabi-gcc-cache
echo "${HOME}/.arm-none-eabi-gcc-cache" >> $GITHUB_PATH

- name: Install STM32 toolchain
env:
Expand All @@ -60,6 +146,7 @@ jobs:
python-version: '3.x'

- name: Install Python tooling
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
pip install --user virtualenv
pip install --upgrade pip
Expand All @@ -84,11 +171,14 @@ jobs:
clang-format --version
.venv/bin/pip3 freeze

- name: Format and lint
run: |
make test_format
make lint
make pylint
- name: Format
run: make test_format

- name: Lint
run: make lint

- name: Pylint
run: make pylint

- name: Build codegen
run: |
Expand Down Expand Up @@ -128,10 +218,14 @@ jobs:
make build_all PLATFORM=stm32f0xx DEFINE="${DEFINES}"
make clean

- name: Build and test
id: build-test
run: |
make build_all PLATFORM=x86 DEFINE="${DEFINES}"
make test_all PLATFORM=x86 DEFINE="${DEFINES}"
make pytest_all
make build_all PLATFORM=x86 COMPILER=clang DEFINE="${DEFINES}"
- name: Build x86
run: make build_all PLATFORM=x86 DEFINE="${DEFINES}"

- name: Test x86
run: make test_all PLATFORM=x86 DEFINE="${DEFINES}"

- name: Pytest
run: make pytest_all

- name: Build x86 with clang
run: make build_all PLATFORM=x86 COMPILER=clang DEFINE="${DEFINES}"