This commit is contained in:
Salvador E. Tropea 2023-02-27 10:31:02 -03:00
commit 6693d29309
12 changed files with 153 additions and 3 deletions

View File

@ -263,6 +263,54 @@ jobs:
ghcr.io/inti-cmnb/kicad6_auto_full:dev
labels: ${{ steps.meta.outputs.labels }}
push_to_registry_ng:
name: Push Docker image to Docker Hub (KiCad 7)
runs-on: ubuntu-latest
needs: test
permissions:
packages: write
contents: read
# Don't create `dev` images using the `master`
if: github.ref == 'refs/heads/dev'
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
setsoft/kicad_auto_test
ghcr.io/inti-cmnb/kicad_auto_test
ghcr.io/inti-cmnb/kicad7_auto_full
tags: |
type=raw,dev_k7
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: tools/dev_image_k7
push: true
tags: |
setsoft/kicad_auto_test:dev_k7
ghcr.io/inti-cmnb/kicad_auto_test:dev_k7
labels: ${{ steps.meta.outputs.labels }}
coveralls:
name: Finish Coveralls
needs: test

View File

@ -93,7 +93,7 @@ if os.environ.get('KIAUS_USE_NIGHTLY'): # pragma: no cover (nightly)
sys_path.insert(0, pcbnew_path)
# This helps other tools like iBoM to pick-up the right pcbnew module
if 'PYTHONPATH' in os.environ:
os.environ['PYTHONPATH'] += ':'+pcbnew_path
os.environ['PYTHONPATH'] += os.pathsep+pcbnew_path
else:
os.environ['PYTHONPATH'] = pcbnew_path
nightly = True

View File

@ -15,6 +15,7 @@ from .macros import macros, pre_class # noqa: F401
from .error import KiPlotConfigurationError
from .gs import GS
from .optionable import Optionable
from .kicad.config import KiConf
from .kiplot import load_board
from .misc import DRC_ERROR
from .log import get_logger
@ -51,6 +52,9 @@ class Run_DRC(BasePreFlight): # noqa: F821
def run(self):
command = self.ensure_tool('KiAuto')
if GS.ki7:
# KiCad 7 can do some library parity checks, but we need to be sure that the KICAD7* vars are defined
KiConf.init(GS.pcb_file)
output = self.get_targets()[0]
os.makedirs(os.path.dirname(output), exist_ok=True)
logger.debug('DRC report: '+output)

View File

@ -855,7 +855,8 @@ def test_import_7(test_dir):
if context.ki7():
ctx.board_file.replace('kicad_pcb', 'kicad_pro')
with open(ctx.board_file.replace('kicad_pcb', 'kicad_pro'), 'wt') as f:
f.write(json.dumps({"board": {"design_settings": {"rule_severities": {"lib_footprint_issues": "ignore"}}}}))
f.write(json.dumps({"board": {"design_settings": {"rule_severities": {"lib_footprint_issues": "ignore",
"lib_footprint_mismatch": "ignore"}}}}))
ctx.run(extra=[])
ctx.expect_out_file('3Rs-drc.txt')
ctx.clean_up()

View File

@ -58,6 +58,39 @@ def test_print_sch_svg_ok(test_dir):
ctx.clean_up()
# @pytest.mark.slow
# @pytest.mark.eeschema
# def test_print_sch_ps_ok(test_dir):
# prj = 'test_v5'
# ctx = context.TestContext(test_dir, prj, 'print_sch_ps')
# ctx.run()
# # Check all outputs are there
# ctx.expect_out_file(SVG_FILE.replace('svg', 'ps'))
# ctx.clean_up()
# @pytest.mark.slow
# @pytest.mark.eeschema
# def test_print_sch_dxf_ok(test_dir):
# prj = 'test_v5'
# ctx = context.TestContext(test_dir, prj, 'print_sch_dxf')
# ctx.run()
# # Check all outputs are there
# ctx.expect_out_file(SVG_FILE.replace('svg', 'dxf'))
# ctx.clean_up()
# @pytest.mark.slow
# @pytest.mark.eeschema
# def test_print_sch_hpgl_ok(test_dir):
# prj = 'test_v5'
# ctx = context.TestContext(test_dir, prj, 'print_sch_hpgl')
# ctx.run()
# # Check all outputs are there
# ctx.expect_out_file(SVG_FILE.replace('svg', 'hpgl'))
# ctx.clean_up()
@pytest.mark.slow
@pytest.mark.eeschema
def test_print_sch_svg_fail(test_dir):

View File

@ -521,7 +521,12 @@ class TestContext(object):
# m = re.match(r'([\d\.e-]+) \(([\d\.e-]+)\)', res.decode())
# assert m
# logging.debug('MSE={} ({})'.format(m.group(1), m.group(2)))
ae = int(res.decode())
s = res.decode()
# Remove error messages generated by KiCad 7 plotted PDFs
s = re.sub(r'^\s+\*+.*', '', s, 0, re.M)
s = re.sub(r'^\s+Output may be incorrect.*', '', s, 0, re.M)
s = s.strip()
ae = int(s)
logging.debug('AE=%d' % ae)
if png_ref:
os.remove(png_ref)

View File

@ -34,3 +34,6 @@ preflight:
- filter_msg: 'Ignore library issues'
error: lib_footprint_issues
regexp: '.*'
- filter_msg: 'Ignore library missmatches'
error: lib_footprint_mismatch
regexp: '.*'

View File

@ -0,0 +1 @@
ibom_all_ops6.kibot.yaml

View File

@ -0,0 +1,11 @@
# Example KiBot config file
kibot:
version: 1
outputs:
- name: 'print_dxf_svg'
comment: "Plot schematic (DXF)"
type: dxf_sch_print
dir: .
options:
output: Schematic.dxf

View File

@ -0,0 +1,11 @@
# Example KiBot config file
kibot:
version: 1
outputs:
- name: 'print_hpgl_svg'
comment: "Plot schematic (HPGL)"
type: hpgl_sch_print
dir: .
options:
output: Schematic.plt

View File

@ -0,0 +1,11 @@
# Example KiBot config file
kibot:
version: 1
outputs:
- name: 'print_ps_svg'
comment: "Plot schematic (PS)"
type: ps_sch_print
dir: .
options:
output: Schematic.ps

View File

@ -0,0 +1,22 @@
FROM setsoft/kicad_auto_test:nightly
MAINTAINER Salvador E. Tropea <stropea@inti.gob.ar>
LABEL Description="KiCad 6 with KiBot and other automation scripts"
RUN dpkg --remove kicost kibot && \
apt-get update && \
curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/dev --output pp.zip && \
unzip pp.zip && \
pip3 install --no-compile KiBot-dev/ && \
rm -rf KiBot-dev pp.zip && \
curl https://codeload.github.com/hildogjr/KiCost/zip/refs/heads/master --output pp.zip && \
unzip pp.zip && \
pip3 install KiCost-master/ && \
rm -rf KiCost-master pp.zip && \
rm -rf /var/lib/apt/lists/*
# kidiff depends on KiAuto
# 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 && \