Loading .gitlab-ci.yml +28 −2 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ include: - local: yaml/yamllint.yml - local: project-automation/pipeline-scheduler.yml - local: project-automation/pages-hugo.yml - local: project-automation/gitlab/py-in-ci.yml - local: docs/prettier.yml pages: stage: test .pages: variables: HUGO_BASEURL: ${CI_PAGES_URL} before_script: Loading @@ -27,6 +27,9 @@ pages: - cp ${CI_PROJECT_DIR}/README.md content/index.md needs: [] pages: stage: test # child pipeline to unit tests all our jobs jobs:c: Loading @@ -50,6 +53,13 @@ jobs:buildah: - local: tests/jobs/buildah.yml strategy: depend jobs:docker-arm64: stage: test trigger: include: - local: tests/jobs/docker-arm64.yml strategy: depend jobs:docs: stage: test trigger: Loading @@ -64,6 +74,22 @@ jobs:python: - local: tests/jobs/python.yml strategy: depend jobs:python:old: stage: test variables: PYVERSION: 3.7-slim trigger: include: - local: tests/jobs/python.yml strategy: depend jobs:python:custom-image: stage: test trigger: include: - local: tests/jobs/python-custom-image.yml strategy: depend # child pipelines to test our off-the-shelf pipelines pipelines:c: stage: test Loading README.md +23 −8 Original line number Diff line number Diff line # Just CI templates v6.4.0 # Just CI templates v6.14.1 Maintainers: Loading Loading @@ -79,11 +79,20 @@ is an example `.gitlab-ci.yml` importing the python template: ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v6.4.0/templates/python.yml - remote: https://just-ci.gitlab.io/jobs/v6.14.1/templates/python.yml variables: PYVERSION: 3.9-slim ``` The above is a template for Python projects. Other templates can be found in `templates/`, for example: The above is a template for Python projects. Here we also add a variable to specify the python version your project uses. If you omit this variable, all CI jobs are run using the latest python version. This may introduce unexpected results, so this variable is highly recommended. You can also omit `-slim` to use the full debian image, or replace it with `-alpine` if you intend to support an alpine based image. Other templates can be found in `templates/`, for example: - Python projects with a `Dockerfile`: `templates/container/python.yml`. This template will use your `Dockerfile` to create an image in which we run tests. Loading @@ -98,7 +107,10 @@ you want you can always disable specific jobs with custom rules. ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v6.4.0/templates/python.yml - remote: https://just-ci.gitlab.io/jobs/v6.14.1/templates/python.yml variables: PYVERSION: 3.9-slim python:pytest: rules: Loading @@ -118,13 +130,16 @@ there has been a breaking change in `master`, use an older tag like this: ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v3.19.2/python/pylint.yml - remote: https://just-ci.gitlab.io/jobs/v5.1.0/python/pylint.yml variables: PYVERSION: 3.7-slim ``` # Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile) We support both! Read [this](pipelines/container.md) for more information on how to configure pipelines for monorepos and polyrepos. We support both! Read [this](container/readme.md) for more information on how to configure pipelines for monorepos and polyrepos. ## Contributing Loading c/cppcheck.yml +19 −12 Original line number Diff line number Diff line --- include: - local: c/generic.yml variables: CPPCHECK_DEFAULT_ARGS: --report-progress --verbose CPPCHECK_EXTRA_ARGS: "" CPPCHECK_ENABLE: all CPPCHECK_EXIT_CODE: 1 c:cppcheck: stage: test image: registry.gitlab.com/just-ci/images/c:latest extends: .c:pre variables: CHECK_PATH: "." # Can be a file DEFAULT_ARGS: "--report-progress --verbose" EXTRA_ARGS: "" ENABLE: "all" ERROR_EXIT_CODE: 1 # Which exit code on failure JOB_PACKAGE: cppcheck-junit script: - cppcheck --xml-version=2 ${DEFAULT_ARGS} ${EXTRA_ARGS} --enable=${ENABLE} --error-exitcode=0 ${CHECK_PATH} 2> cppcheck-result.xml - cppcheck_junit cppcheck-result.xml cppcheck-junit.xml - cppcheck ${EXTRA_ARGS} --enable=${ENABLE} --error-exitcode=${ERROR_EXIT_CODE} ${CHECK_PATH} - !reference [".c:pre", script] - cppcheck --xml-version=2 ${CPPCHECK_DEFAULT_ARGS} ${CPPCHECK_EXTRA_ARGS} --enable=${CPPCHECK_ENABLE} --error-exitcode=${CPPCHECK_EXIT_CODE} . 2> ${CI_PROJECT_DIR}/cppcheck-result.xml after_script: - cppcheck_junit ${CI_PROJECT_DIR}/cppcheck-result.xml ${CI_PROJECT_DIR}/cppcheck-junit.xml needs: [] artifacts: reports: junit: cppcheck-junit.xml when: always c/flawfinder.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line --- # https://dwheeler.com/flawfinder/ include: - local: c/generic.yml variables: FLAWFINDER_ERROR_LEVEL: "3" FLAWFINDER_MIN_LEVEL: "1" FLAWFINDER_DEFAULT_ARGS: --falsepositive --immediate --context FLAWFINDER_EXTRA_ARGS: "" c:flawfinder: extends: .c:pre variables: JOB_PACKAGE: flawfinder script: - !reference [".c:pre", script] - flawfinder ${FLAWFINDER_DEFAULT_ARGS} ${FLAWFINDER_EXTRA_ARGS} --minlevel ${FLAWFINDER_MIN_LEVEL} --error-level=${FLAWFINDER_ERROR_LEVEL} . c/generic.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line --- variables: C_EXCLUDE_PATHS: tests C_EXCLUDE_REGEX: (tests) .c:pre: image: name: registry.gitlab.com/just-ci/images/c:latest entrypoint: [""] stage: test script: - pip3 install -q ${JOB_PACKAGE} && echo "[+] ${JOB_PACKAGE} successfully installed." - | echo "[*] Job info:" echo "Context path: ${C_CONTEXT:=.}" echo "Excluded paths: ${C_EXCLUDE_PATHS:-(not specified)}" echo "Excluded regex: ${C_EXCLUDE_REGEX:-(not specified)}" - cd ${C_CONTEXT} Loading
.gitlab-ci.yml +28 −2 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ include: - local: yaml/yamllint.yml - local: project-automation/pipeline-scheduler.yml - local: project-automation/pages-hugo.yml - local: project-automation/gitlab/py-in-ci.yml - local: docs/prettier.yml pages: stage: test .pages: variables: HUGO_BASEURL: ${CI_PAGES_URL} before_script: Loading @@ -27,6 +27,9 @@ pages: - cp ${CI_PROJECT_DIR}/README.md content/index.md needs: [] pages: stage: test # child pipeline to unit tests all our jobs jobs:c: Loading @@ -50,6 +53,13 @@ jobs:buildah: - local: tests/jobs/buildah.yml strategy: depend jobs:docker-arm64: stage: test trigger: include: - local: tests/jobs/docker-arm64.yml strategy: depend jobs:docs: stage: test trigger: Loading @@ -64,6 +74,22 @@ jobs:python: - local: tests/jobs/python.yml strategy: depend jobs:python:old: stage: test variables: PYVERSION: 3.7-slim trigger: include: - local: tests/jobs/python.yml strategy: depend jobs:python:custom-image: stage: test trigger: include: - local: tests/jobs/python-custom-image.yml strategy: depend # child pipelines to test our off-the-shelf pipelines pipelines:c: stage: test Loading
README.md +23 −8 Original line number Diff line number Diff line # Just CI templates v6.4.0 # Just CI templates v6.14.1 Maintainers: Loading Loading @@ -79,11 +79,20 @@ is an example `.gitlab-ci.yml` importing the python template: ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v6.4.0/templates/python.yml - remote: https://just-ci.gitlab.io/jobs/v6.14.1/templates/python.yml variables: PYVERSION: 3.9-slim ``` The above is a template for Python projects. Other templates can be found in `templates/`, for example: The above is a template for Python projects. Here we also add a variable to specify the python version your project uses. If you omit this variable, all CI jobs are run using the latest python version. This may introduce unexpected results, so this variable is highly recommended. You can also omit `-slim` to use the full debian image, or replace it with `-alpine` if you intend to support an alpine based image. Other templates can be found in `templates/`, for example: - Python projects with a `Dockerfile`: `templates/container/python.yml`. This template will use your `Dockerfile` to create an image in which we run tests. Loading @@ -98,7 +107,10 @@ you want you can always disable specific jobs with custom rules. ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v6.4.0/templates/python.yml - remote: https://just-ci.gitlab.io/jobs/v6.14.1/templates/python.yml variables: PYVERSION: 3.9-slim python:pytest: rules: Loading @@ -118,13 +130,16 @@ there has been a breaking change in `master`, use an older tag like this: ```yaml --- include: - remote: https://just-ci.gitlab.io/jobs/v3.19.2/python/pylint.yml - remote: https://just-ci.gitlab.io/jobs/v5.1.0/python/pylint.yml variables: PYVERSION: 3.7-slim ``` # Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile) We support both! Read [this](pipelines/container.md) for more information on how to configure pipelines for monorepos and polyrepos. We support both! Read [this](container/readme.md) for more information on how to configure pipelines for monorepos and polyrepos. ## Contributing Loading
c/cppcheck.yml +19 −12 Original line number Diff line number Diff line --- include: - local: c/generic.yml variables: CPPCHECK_DEFAULT_ARGS: --report-progress --verbose CPPCHECK_EXTRA_ARGS: "" CPPCHECK_ENABLE: all CPPCHECK_EXIT_CODE: 1 c:cppcheck: stage: test image: registry.gitlab.com/just-ci/images/c:latest extends: .c:pre variables: CHECK_PATH: "." # Can be a file DEFAULT_ARGS: "--report-progress --verbose" EXTRA_ARGS: "" ENABLE: "all" ERROR_EXIT_CODE: 1 # Which exit code on failure JOB_PACKAGE: cppcheck-junit script: - cppcheck --xml-version=2 ${DEFAULT_ARGS} ${EXTRA_ARGS} --enable=${ENABLE} --error-exitcode=0 ${CHECK_PATH} 2> cppcheck-result.xml - cppcheck_junit cppcheck-result.xml cppcheck-junit.xml - cppcheck ${EXTRA_ARGS} --enable=${ENABLE} --error-exitcode=${ERROR_EXIT_CODE} ${CHECK_PATH} - !reference [".c:pre", script] - cppcheck --xml-version=2 ${CPPCHECK_DEFAULT_ARGS} ${CPPCHECK_EXTRA_ARGS} --enable=${CPPCHECK_ENABLE} --error-exitcode=${CPPCHECK_EXIT_CODE} . 2> ${CI_PROJECT_DIR}/cppcheck-result.xml after_script: - cppcheck_junit ${CI_PROJECT_DIR}/cppcheck-result.xml ${CI_PROJECT_DIR}/cppcheck-junit.xml needs: [] artifacts: reports: junit: cppcheck-junit.xml when: always
c/flawfinder.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line --- # https://dwheeler.com/flawfinder/ include: - local: c/generic.yml variables: FLAWFINDER_ERROR_LEVEL: "3" FLAWFINDER_MIN_LEVEL: "1" FLAWFINDER_DEFAULT_ARGS: --falsepositive --immediate --context FLAWFINDER_EXTRA_ARGS: "" c:flawfinder: extends: .c:pre variables: JOB_PACKAGE: flawfinder script: - !reference [".c:pre", script] - flawfinder ${FLAWFINDER_DEFAULT_ARGS} ${FLAWFINDER_EXTRA_ARGS} --minlevel ${FLAWFINDER_MIN_LEVEL} --error-level=${FLAWFINDER_ERROR_LEVEL} .
c/generic.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line --- variables: C_EXCLUDE_PATHS: tests C_EXCLUDE_REGEX: (tests) .c:pre: image: name: registry.gitlab.com/just-ci/images/c:latest entrypoint: [""] stage: test script: - pip3 install -q ${JOB_PACKAGE} && echo "[+] ${JOB_PACKAGE} successfully installed." - | echo "[*] Job info:" echo "Context path: ${C_CONTEXT:=.}" echo "Excluded paths: ${C_EXCLUDE_PATHS:-(not specified)}" echo "Excluded regex: ${C_EXCLUDE_REGEX:-(not specified)}" - cd ${C_CONTEXT}