Implement target in Makefile to run github CI-like checks locally (#1753)

* Makefile: implement tests target with subtargets to run github CI-like tests locally (in docker container)

* Dockerfile: update comment for PIP packages
This commit is contained in:
Ivan Zorin
2023-07-23 15:18:45 +03:00
committed by GitHub
parent 65dd3e879c
commit f83ebc8c81
2 changed files with 48 additions and 12 deletions

View File

@@ -6,21 +6,22 @@ LABEL maintainer="Ben V. Brown <ralim@ralimtek.com>"
# Default current dir when container starts
WORKDIR /build/ironos
# Installing the two compilers (ARM & RISCV), python3 & pip, clang tools:
# Installing the two compilers (ARM & RISCV), python3 & pip, clang tools, etc.:
## - compilers: gcc-*, newlib-*
## - python3: py*, black (required to check Python code formatting)
## - misc: findutils, make, git, diffutils
## - musl-dev (required for the multi lang firmwares)
## - clang (required for clang-format to check C++ code formatting)
## - shellcheck (to check sh scripts)
ARG APK_COMPS="gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf \
newlib-arm-none-eabi"
ARG APK_PYTHON="python3 py3-pip black"
ARG APK_MISC="findutils make git diffutils"
ARG APK_DEV="musl-dev clang bash clang-extra-tools"
ARG APK_DEV="musl-dev clang bash clang-extra-tools shellcheck"
# PIP packages
ARG PIP_PKGS='bdflib'
# PIP packages to check & test Python code
ARG PIP_PKGS='bdflib flake8'
# Install system packages using alpine package manager
RUN apk add --no-cache ${APK_COMPS} ${APK_PYTHON} ${APK_MISC} ${APK_DEV}
@@ -31,5 +32,5 @@ RUN python3 -m pip install ${PIP_PKGS}
# Git trust to avoid related warning
RUN git config --global --add safe.directory /build/ironos
COPY . /build/ironos
COPY ./scripts/ci /build/ci
COPY . /build/ironos
COPY ./scripts/ci /build/ci