Switch QA CI to matrix format and rename jobs

This commit is contained in:
Ian McInerney 2021-04-09 12:32:17 +01:00
parent 3450610977
commit 8c3d424701
2 changed files with 28 additions and 125 deletions

View File

@ -1,7 +1,7 @@
##########################################################################
# Build KiCad on Fedora and save the results
##########################################################################
build_linux:
fedora_build_linux:
stage: build
extends: .only_code
interruptible: false
@ -49,12 +49,12 @@ build_linux:
- build/linux/compilation_log.txt
# Upload the compilation log in an easily downloadable form
report_build_warn:
fedora_report_build_warn:
stage: report
extends: .only_code
when: always
needs:
- job: build_linux
- job: fedora_build_linux
artifacts: true
script:
- echo "Uploading compilation log"
@ -67,15 +67,15 @@ report_build_warn:
- compilation_log.txt
# Report on the metrics of the code
report_metrics:
fedora_report_metrics:
stage: report
extends: .only_code
when: always
needs:
- job: build_linux
- job: fedora_build_linux
artifacts: true
script:
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_warnings "NR}' > metrics.txt
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_fedora_warnings "NR}' > metrics.txt
- cat metrics.txt
artifacts:
reports:
@ -83,68 +83,15 @@ report_metrics:
##########################################################################
# Run the code unit tests. Each QA executable is split into a separate job so that the display
# gives the test results broken down by the test executable.
# Run the code unit tests.
##########################################################################
.unit_test_fedora:
fedora_qa:
extends:
- .unit_test
- .only_code
parallel:
matrix:
- TEST: [qa_python, qa_common, qa_gerbview, qa_pcbnew, qa_eeschema, qa_kimath, qa_sexpr, qa_kicad2step]
needs:
- job: build_linux
- job: fedora_build_linux
artifacts: true
qa_python:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_python'
qa_common:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_common'
qa_gerbview:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_gerbview'
qa_pcbnew:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_pcbnew'
qa_eeschema:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_eeschema'
qa_kimath:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_kimath'
qa_sexpr:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_sexpr'
qa_kicad2step:
extends:
- .unit_test_fedora
- .only_code
variables:
TEST: 'qa_kicad2step'

View File

@ -1,7 +1,7 @@
##########################################################################
# Build KiCad on Ubuntu 20.04 and save the results
##########################################################################
build_ubuntu20.04:
ubuntu20.04_build:
stage: build
tags:
- kicad-ubuntu20.04
@ -13,7 +13,7 @@ build_ubuntu20.04:
- schedules
interruptible: false
cache:
key: "cache-ubuntu-linux"
key: "cache-ubuntu20.04-linux"
paths:
- ccache/
before_script:
@ -57,7 +57,7 @@ build_ubuntu20.04:
- build/linux/compilation_log.txt
# Upload the compilation log in an easily downloadable form
report_build_warn_ubuntu20.04:
ubuntu20.04_report_build_warn:
stage: report
when: always
only:
@ -66,7 +66,7 @@ report_build_warn_ubuntu20.04:
except:
- schedules
needs:
- job: build_ubuntu20.04
- job: ubuntu20.04_build
artifacts: true
script:
- echo "Uploading compilation log"
@ -79,7 +79,7 @@ report_build_warn_ubuntu20.04:
- compilation_log.txt
# Report on the metrics of the code
report_metrics_ubuntu20.04:
ubuntu20.04_report_metrics:
stage: report
when: always
only:
@ -88,24 +88,23 @@ report_metrics_ubuntu20.04:
except:
- schedules
needs:
- job: build_ubuntu20.04
- job: ubuntu20.04_build
artifacts: true
script:
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_warnings "NR}' > metrics.txt
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_ubuntu_20.04_warnings "NR}' > metrics.txt
- cat metrics.txt
artifacts:
reports:
metrics: metrics.txt
##########################################################################
# Run the code unit tests. Each QA executable is split into a separate job so that the display
# gives the test results broken down by the test executable.
# Run the code unit tests.
##########################################################################
.unit_test_ubuntu20.04:
ubuntu20.04_qa:
extends:
- .unit_test
needs:
- job: build_ubuntu20.04
- job: ubuntu20.04_build
artifacts: true
tags:
- kicad-ubuntu20.04
@ -113,51 +112,8 @@ report_metrics_ubuntu20.04:
only:
- branches@kicad/code/kicad
- tags@kicad/code/kicad
qa_python_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_python'
qa_common_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_common'
qa_gerbview_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_gerbview'
qa_pcbnew_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_pcbnew'
qa_eeschema_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_eeschema'
qa_kimath_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_kimath'
qa_sexpr_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_sexpr'
qa_kicad2step_ubuntu20.04:
extends:
- .unit_test_ubuntu20.04
variables:
TEST: 'qa_kicad2step'
except:
- schedules
parallel:
matrix:
- TEST: [qa_python, qa_common, qa_gerbview, qa_pcbnew, qa_eeschema, qa_kimath, qa_sexpr, qa_kicad2step]