From 1f6e6c6dfcb077e1583b52d5079fe53dcab2104a Mon Sep 17 00:00:00 2001 From: Abdullah Shahid <74064210+abdullahs26@users.noreply.github.com> Date: Sun, 19 Sep 2021 23:34:16 -0400 Subject: [PATCH] [SOFT-499] Upgrade CI to Ubuntu 18.04 (#413) GitHub Actions phases out Ubuntu 16.04 at midnight, so we're upgrading less than half an hour before the deadline. --- .github/workflows/main.yml | 20 +++----------------- Makefile | 12 ++++++++++++ make/filter.mk | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index baeecc67a..8f89b2aa4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ env: jobs: build: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 timeout-minutes: 12 steps: - uses: actions/checkout@v2 @@ -55,21 +55,6 @@ jobs: tar -xjf $GCC_ARCHIVE_PATH echo "${HOME}/${GCC_PATH}/bin" >> $GITHUB_PATH - - name: Install GNU Make 4.1 - env: - 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 - run: | - wget -nv $MAKE_URL - tar xvf $MAKE_ARCHIVE_PATH - cd $MAKE_PATH - ./configure --prefix=${HOME}/.local - make - make install - cd .. - rm -rf $MAKE_PATH - - uses: actions/setup-python@v2 with: python-version: '3.x' @@ -79,7 +64,8 @@ jobs: pip install --user virtualenv pip install --upgrade pip pip install --upgrade setuptools - make install_requirements + sudo apt install python3-testresources + make install_requirements_ci - name: Force PATH to update run: hash -r diff --git a/Makefile b/Makefile index b03c2bd17..37a7e495c 100644 --- a/Makefile +++ b/Makefile @@ -422,6 +422,18 @@ codecov: lcov -r coverage.info $(IGNORE_CODECOV_FILES) -o coverage.info && \ genhtml coverage.info --output-directory ../../../$(CODECOV_DIR) --legend --show-details +# Required for CI to build successfully +.PHONY: install_requirements_ci +install_requirements_ci: + @sudo apt-get install lcov -y + @sudo apt-get update + @sudo apt-get install protobuf-compiler + @rm -rf $(VENV_DIR) + @mkdir $(VENV_DIR) + @virtualenv $(VENV_DIR) + @. $(VENV_DIR)/bin/activate; \ + pip install -r requirements.txt + MU_PROJS := -include $(MU_DIR)/integration_tests/deps.mk diff --git a/make/filter.mk b/make/filter.mk index 8de793bce..c48f43129 100644 --- a/make/filter.mk +++ b/make/filter.mk @@ -9,7 +9,7 @@ VALID_LIBRARIES := $(patsubst $(LIB_DIR)/%/rules.mk,%,$(wildcard $(LIB_DIR)/*/ru # - For test, gdb, and program, check to see if PLATFORM and {PROJECT or {LIBRARY and TEST}} are valid # - For build, check if PLATFORM and {PROJECT or LIBRARY} are valid -ifneq (,$(filter clean lint lint_quick pylint format format_quick build_all test_all codecov test_format socketcan codegen codegen_dbc codegen_protos codegen_test mock_can_data babydriver bootloader_protos install_mu mu fastmu pylint_quick pyformat pyformat_quick pytest_all pytest install_requirements,$(MAKECMDGOALS))) +ifneq (,$(filter clean lint lint_quick pylint format format_quick build_all test_all codecov test_format socketcan codegen codegen_dbc codegen_protos codegen_test mock_can_data babydriver bootloader_protos install_mu mu fastmu pylint_quick pyformat pyformat_quick pytest_all pytest install_requirements install_requirements_ci,$(MAKECMDGOALS))) # Universal operation: do nothing - args are not used or only PLATFORM is checked else ifneq (,$(filter new,$(MAKECMDGOALS))) # New project: just make sure PROJECT or LIBRARY is defined