diff --git a/makefile b/makefile index f1507b5..83ac90d 100644 --- a/makefile +++ b/makefile @@ -1,16 +1,16 @@ -# This is a default makefile for the Zephyr project, that is supposed to be -# initialized with West and built with East. +# This is a default makefile for the Zephyr project, that is supposed to be +# initialized with West and built with East. # # This makefile in combination with the Github actions does the following: # * Installs python dependencies and toolchain # * Initializes the project with West and updates it # * Runs east release -# If the _build_ is running due to the release creation, then the following also +# If the _build_ is running due to the release creation, then the following also # happens: # * Creates 'artefacts' folder, # * Copies release zip files and extra release notes files into it. # -# Downloaded West modules, toolchain and nrfutil-toolchain-manager are cached in +# Downloaded West modules, toolchain and nrfutil-toolchain-manager are cached in # CI after the first time the entire build is run. # # The assumed precondition is that the repo was setup with below commands: @@ -18,40 +18,36 @@ # cd /project # git clone . # -# Every target assumes that is run from the repo's root directory, which is +# Every target assumes that is run from the repo's root directory, which is # /project. install-dep: - # Install gcc-multilib for 32-bit support - sudo apt-get update - sudo apt-get install gcc-multilib - pip install -r scripts/requirements.txt - east sys-setup + east install nrfutil-toolchain-manager # Below line is needed, as the toolchain manager might be cached in CI, but not configured - ~/.local/share/east/nrfutil-toolchain-manager.exe config --install-dir ~/.local/share/east - -install-test-dep: - sudo apt-get install gcc-multilib lcov - pip install junit2html + ~/.local/share/east/tooling/nrfutil/nrfutil-toolchain-manager.exe config --install-dir ~/.local/share/east project-setup: # Make a West workspace around this project - west init -l . + east init -l . # Use a faster update method - west update -o=--depth=1 -n - east update toolchain + east update -o=--depth=1 -n + east install toolchain pre-build: echo "Pre-build" -build: - # Change east.yml to control what is built. - # east release +# Runs on every push to the main branch +quick-build: + east build -b nrf52840dk_nrf52840 tests/flash_read_write + +# Runs on every PR and when doing releases +release: + # This is empty on purpose, no artefacts are generated by this repo. # Pre-package target is only run in release process. pre-package: mkdir -p artefacts - # cp release/*.zip artefacts + cp release/*.zip artefacts cp scripts/pre_changelog.md artefacts cp scripts/post_changelog.md artefacts @@ -61,6 +57,24 @@ test: test-report-ci: junit2html twister-out/twister.xml twister-out/twister-report.html -# Intended to be used by developer +# Intended to be used by developer, use 'pip install junit2html' to install +# tooling test-report: test-report-ci firefox twister-out/twister-report.html + +# Twister's coverage report by default includes all Zephyr sources, which is not +# what we want. Below coverage-report-ci target removes all Zephyr sources from +# coverage.info and generates a new coverage report. +REMOVE_DIR = $(shell realpath $(shell pwd)/../zephyr) + +# This target is used in CI. It differs from coverage-report target in that it +# removes "project/" from the paths in coverage.info, so that the GitHub action +# that makes the coverage report can create proper links to the source files. +coverage-report-ci: + rm -fr twister-out/coverage + lcov -q --remove twister-out/coverage.info "${REMOVE_DIR}/*" -o twister-out/coverage.info --rc lcov_branch_coverage=1 + +# Intended to be used by developer +coverage-report: coverage-report-ci + genhtml -q --output-directory twister-out/coverage --ignore-errors source --branch-coverage --highlight --legend twister-out/coverage.info + firefox twister-out/coverage/index.html