[CI/CD] Now using KiAuto release

This commit is contained in:
Salvador E. Tropea 2022-08-11 19:14:46 -03:00
parent 7c82ae591b
commit 4447b5b306
4 changed files with 37 additions and 39 deletions

View File

@ -47,35 +47,29 @@ jobs:
run: |
rm -rf output
rm -f tests/.local
#### Experimental stuff:
# Remove KiAuto
dpkg --remove kiauto
# Install KiAuto@master
curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip
unzip pp.zip
pip3 install KiAuto-master/
# Clean the downloaded stuff
rm -rf KiAuto-master/ pp.zip
# Check what we got
echo $PATH
ls -la /usr/bin/*_do || true
ls -la /usr/local/bin/*_do || true
which pcbnew_do
pcbnew_do --version
#### End Experimental stuff
# Unify coverage versions to allow combine
pip3 install --upgrade coverage==5.1
ln -s /usr/local/bin/coverage3 /usr/local/bin/python3-coverage || true
# The KiCad 5 image currently has a very old pytest (no parallel run)
pip3 install --upgrade pytest
pip3 install --upgrade pytest-xdist
##### Experimental stuff:
## Remove KiAuto
#dpkg --remove kiauto
## Install KiAuto@master
#curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip
#unzip pp.zip
#pip3 install KiAuto-master/
## Clean the downloaded stuff
#rm -rf KiAuto-master/ pp.zip
## Check what we got
#echo $PATH
#ls -la /usr/bin/*_do || true
#ls -la /usr/local/bin/*_do || true
#which pcbnew_do
#pcbnew_do --version
##### End Experimental stuff
# Ensure we start a fresh coverage meassurement
python3-coverage erase
# Create the caches with macros
python3-coverage run src/kibot --help-outputs > /dev/null
# Individual run for specific tests
# pytest --log-cli-level debug -k "test_ibom_parse_fail" --test_dir=output
# Run the 90% faster tests (under 3 s)
# Run the 90% faster tests (under 3 s) together
# Do it in parallel
./${{ matrix.w_tests }}.sh
- name: Store coverage

View File

@ -93,7 +93,7 @@ test_docker_local_1_ki6:
# Run in the same directory to make the __pycache__ valid
# Also change the owner of the files to the current user (we run as root like in GitHub)
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" setsoft/kicad_auto_test:ki6 \
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run -a src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k 'test_dep_pytool' --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/"
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k 'test_dep_pytool' --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/"
#$(PY_COV) report
#x-www-browser htmlcov/index.html
@ -104,10 +104,10 @@ test_docker_local:
# Run in the same directory to make the __pycache__ valid
# Also change the owner of the files to the current user (we run as root like in GitHub)
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" setsoft/kicad_auto_test:latest \
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run -a src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage htmlcov/"
# $(PY_COV) report
# x-www-browser htmlcov/index.html
$(PY_COV) erase
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage htmlcov/"
$(PY_COV) combine
$(PY_COV) report
x-www-browser htmlcov/index.html
test_docker_local_ki6:
rm -rf output
@ -116,7 +116,7 @@ test_docker_local_ki6:
# Run in the same directory to make the __pycache__ valid
# Also change the owner of the files to the current user (we run as root like in GitHub)
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" setsoft/kicad_auto_test:ki6 \
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run -a src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage htmlcov/"
/bin/bash -c "flake8 . --count --statistics ; python3-coverage run src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage htmlcov/"
$(PY_COV) combine
$(PY_COV) report
x-www-browser htmlcov/index.html

View File

@ -2,7 +2,7 @@ FROM setsoft/kicad_auto:latest
MAINTAINER Salvador E. Tropea <stropea@inti.gob.ar>
LABEL Description="KiCad 5 with KiBot and other automation scripts"
RUN dpkg --remove kicost kibot kiauto && \
RUN dpkg --remove kicost kibot && \
apt-get update && \
apt-get -y install --no-install-recommends python3-pip unzip curl python3-setuptools python3-wheel && \
curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/master --output pp.zip && \
@ -13,9 +13,11 @@ RUN dpkg --remove kicost kibot kiauto && \
unzip pp.zip && \
pip3 install KiCost-master/ && \
rm -rf KiCost-master pp.zip && \
curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
unzip pp.zip && \
pip3 install KiAuto-master/ && \
rm -rf KiAuto-master/ pp.zip && \
apt-get -y remove curl python3-pip unzip python3-setuptools python3-wheel && \
rm -rf /var/lib/apt/lists/*
# dpkg --remove kiauto && \
# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
# unzip pp.zip && \
# pip3 install KiAuto-master/ && \
# rm -rf KiAuto-master/ pp.zip && \

View File

@ -2,7 +2,7 @@ FROM setsoft/kicad_auto:ki6
MAINTAINER Salvador E. Tropea <stropea@inti.gob.ar>
LABEL Description="KiCad 6 with KiBot and other automation scripts"
RUN dpkg --remove kicost kibot kiauto && \
RUN dpkg --remove kicost kibot && \
apt-get update && \
apt-get -y install --no-install-recommends -t bullseye-backports python3-pip unzip curl python3-setuptools python3-wheel && \
curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/master --output pp.zip && \
@ -13,10 +13,12 @@ RUN dpkg --remove kicost kibot kiauto && \
unzip pp.zip && \
pip3 install KiCost-master/ && \
rm -rf KiCost-master pp.zip && \
curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
unzip pp.zip && \
pip3 install KiAuto-master/ && \
rm -rf KiAuto-master/ pp.zip && \
apt-get -y remove curl python3-pip unzip python3-setuptools python3-wheel && \
rm -rf /var/lib/apt/lists/*
# dpkg --remove kiauto && \
# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
# unzip pp.zip && \
# pip3 install KiAuto-master/ && \
# rm -rf KiAuto-master/ pp.zip && \