mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-16 12:33:43 +00:00
docker-based linters
This commit is contained in:
27
.github/workflows/ccpp.yml
vendored
27
.github/workflows/ccpp.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: deps
|
|
||||||
run: |
|
|
||||||
sudo dpkg -R python3
|
|
||||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y --no-install-recommends python3.8 python3.8-distutils build-essential libevent-dev libjpeg-turbo8-dev uuid-dev libbsd-dev
|
|
||||||
sudo python3.8 get-pip.py
|
|
||||||
sudo python3.8 -m pip install tox
|
|
||||||
- name: make
|
|
||||||
run: make
|
|
||||||
- name: make tox
|
|
||||||
run: make tox
|
|
||||||
20
.github/workflows/dockerimage.yml
vendored
Normal file
20
.github/workflows/dockerimage.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Building linters image ...
|
||||||
|
run: make linters
|
||||||
|
|
||||||
|
- name: Running linters ...
|
||||||
|
run: make tox
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
/.tox/
|
/linters/.tox/
|
||||||
/.mypy_cache/
|
/linters/.mypy_cache/
|
||||||
/pkg/arch/pkg/
|
/pkg/arch/pkg/
|
||||||
/pkg/arch/src/
|
/pkg/arch/src/
|
||||||
/pkg/arch/v*.tar.gz
|
/pkg/arch/v*.tar.gz
|
||||||
|
|||||||
28
Makefile
28
Makefile
@@ -13,6 +13,8 @@ RPI_VC_LIBS ?= /opt/vc/lib
|
|||||||
|
|
||||||
BUILD ?= build
|
BUILD ?= build
|
||||||
|
|
||||||
|
LINTERS_IMAGE ?= $(PROG)-linters
|
||||||
|
|
||||||
|
|
||||||
# =====
|
# =====
|
||||||
_LIBS = -lm -ljpeg -pthread -levent -levent_pthreads -luuid
|
_LIBS = -lm -ljpeg -pthread -levent -levent_pthreads -luuid
|
||||||
@@ -99,8 +101,22 @@ release:
|
|||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
|
||||||
tox:
|
tox: linters
|
||||||
tox -q -c tox.ini $(if $(E),-e $(E),-p auto)
|
time docker run --rm \
|
||||||
|
--volume `pwd`:/src:ro \
|
||||||
|
--volume `pwd`/linters:/src/linters:rw \
|
||||||
|
-t $(LINTERS_IMAGE) bash -c " \
|
||||||
|
cd /src \
|
||||||
|
&& tox -q -c linters/tox.ini $(if $(E),-e $(E),-p auto) \
|
||||||
|
"
|
||||||
|
|
||||||
|
|
||||||
|
linters:
|
||||||
|
docker build \
|
||||||
|
$(if $(call optbool,$(NC)),--no-cache,) \
|
||||||
|
--rm \
|
||||||
|
--tag $(LINTERS_IMAGE) \
|
||||||
|
-f linters/Dockerfile linters
|
||||||
|
|
||||||
|
|
||||||
bump:
|
bump:
|
||||||
@@ -112,8 +128,12 @@ push:
|
|||||||
git push --tags
|
git push --tags
|
||||||
|
|
||||||
|
|
||||||
clean-all: clean
|
clean-all: linters clean
|
||||||
rm -rf .mypy-cache .tox
|
- docker run --rm \
|
||||||
|
--volume `pwd`:/src \
|
||||||
|
-it $(LINTERS_IMAGE) bash -c "cd src && rm -rf linters/{.tox,.mypy_cache}"
|
||||||
clean:
|
clean:
|
||||||
rm -rf pkg/arch/pkg pkg/arch/src pkg/arch/v*.tar.gz pkg/arch/ustreamer-*.pkg.tar.{xz,zst}
|
rm -rf pkg/arch/pkg pkg/arch/src pkg/arch/v*.tar.gz pkg/arch/ustreamer-*.pkg.tar.{xz,zst}
|
||||||
rm -rf $(PROG) $(BUILD) vgcore.* *.sock
|
rm -rf $(PROG) $(BUILD) vgcore.* *.sock
|
||||||
|
|
||||||
|
.PHONY: linters
|
||||||
|
|||||||
21
linters/Dockerfile
Normal file
21
linters/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM archlinux/base
|
||||||
|
|
||||||
|
RUN echo "Server = http://mirror.yandex.ru/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
RUN pacman -Syu --noconfirm \
|
||||||
|
&& pacman -S --needed --noconfirm \
|
||||||
|
base \
|
||||||
|
base-devel \
|
||||||
|
vim \
|
||||||
|
git \
|
||||||
|
libjpeg \
|
||||||
|
libevent \
|
||||||
|
libutil-linux \
|
||||||
|
libbsd \
|
||||||
|
python \
|
||||||
|
python-pip \
|
||||||
|
python-tox \
|
||||||
|
cppcheck \
|
||||||
|
&& (pacman -Sc --noconfirm || true)
|
||||||
|
|
||||||
|
CMD /bin/bash
|
||||||
@@ -4,7 +4,7 @@ skipsdist = true
|
|||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython = python3.8
|
basepython = python3.8
|
||||||
sitepackages = true
|
changedir = /src
|
||||||
|
|
||||||
[testenv:cppcheck]
|
[testenv:cppcheck]
|
||||||
whitelist_externals = cppcheck
|
whitelist_externals = cppcheck
|
||||||
Reference in New Issue
Block a user