Commit a23af6d1 authored by Ruben ten Hove's avatar Ruben ten Hove
Browse files

Merge branch 'main' of gitlab.com:just-ci/templates into beta

parents 795c50da bc6a335b
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -2,7 +2,10 @@
# CI of ci/templates itself

variables:
  SCHEDULE_PIPELINE_PROJECT_IDS: 30771297 30771293 30771284 30771254 30771239
  SCHEDULE_PIPELINE_PROJECT_IDS:
    30771297 30771293 30771284 30771254 30771239 30933363
  SCHEDULE_PIPELINE_DESCRIPTION: CI Daily Update
  SCHEDULE_PIPELINE_CRON: 0 10 * * * # Every day at 10:00
  GITLAB_RECOMMENDED_AUTO_FIX: "true"
  RELEASE_CHANGELOG: "false"

@@ -11,10 +14,12 @@ 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:
    - cd tests/mockup_projects/pages
    - git clone https://github.com/alexandrevicenzi/soho.git themes/soho
@@ -22,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:
@@ -59,6 +67,13 @@ jobs:python:
      - 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
+5 −11
Original line number Diff line number Diff line
# Just CI templates v6.1.0-beta.4
# Just CI templates v6.8.0

Maintainers:

@@ -72,16 +72,14 @@ to:

## Choosing a template

You can import our templates in your projects using GitLab
You can import our templates in your projects using GitLab remote
[include](https://docs.gitlab.com/ee/ci/yaml/includes.html) functionality. Here
is an example `.gitlab-ci.yml` importing the python template:

```yaml
---
include:
  - project: just-ci/templates
    file: templates/python.yml
    ref: v6.1.0-beta.4
  - remote: https://just-ci.gitlab.io/jobs/v6.8.0/templates/python.yml
```

The above is a template for Python projects. Other templates can be found in
@@ -100,9 +98,7 @@ you want you can always disable specific jobs with custom rules.
```yaml
---
include:
  - project: just-ci/templates
    file: templates/python.yml
    ref: v6.1.0-beta.4
  - remote: https://just-ci.gitlab.io/jobs/v6.8.0/templates/python.yml

python:pytest:
  rules:
@@ -122,9 +118,7 @@ there has been a breaking change in `master`, use an older tag like this:
```yaml
---
include:
  - project: just-ci/templates
    file: python/pylint.yml
    ref: v3.19.2
  - remote: https://just-ci.gitlab.io/jobs/v3.19.2/python/pylint.yml
```

# Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile)
+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