Commit 86ebb466 authored by Teake Nutma's avatar Teake Nutma
Browse files

Merge branch 'tnutma/feature/test-badge' into 'tnutma/dummy-branch'

Dummy MR to test changed_files

See merge request omegacen/ci-templates!54
parents 308b518d 03467dd5
image: node:lts-alpine
include:
- local: '/templates/shared/stages.yml'
- local: '/templates/changedfiles.yml'
# TODO: replace with https://docs.gitlab.com/ee/api/lint.html
lint:
stage: lint
image: node:lts-alpine
script:
- npm install -g gitlab-ci-lint
- find . \( -name '*.yaml' -o -name '*.yml' \) -print -exec gitlab-ci-lint --url https://gitlab.astro-wise.org "{}" \;
build_containers:
variables:
GIT_DEPTH: 0
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- cat changed_files.log
include:
- local: '/conda-build.yml'
- local: '/conda-release.yml'
stages:
- lint
- build
- test
- quality
- release
include:
- local: '/templates/shared/stages.yml'
compare_ast:
stage: lint
......
include:
- local: '_autoformat.yml'
- local: '_shared.yml'
variables:
AUTOFORMAT_COMPARE_AST: 1
......
include:
- local: '_autoformat.yml'
- local: '_shared.yml'
autopep8:
extends: .autoformat_mr
......
# Stores the list of changed files in a CI artifact `changed_files.log`.
# Useful for subsequent jobs that need such a list but cannot generate it
# themselves (e.g. because they don't have access to git, such as jobs in
# the kaniko image).
# Storing the list of changed files in a dotenv file (and subsequently exposing
# it as an environment variable) would have been nicer. But we cannot store the
# list of changed files in dotenv file because at the time
# of writing GitLab does not support multiline dotenv variables. This is not
# explicitly stated in the docs [1], but is apparent from this discussion [2]
# and from the actual source code [3]. MR to fix docs is [4].
#
# [1] https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsdotenv,
# [2] https://gitlab.com/gitlab-org/gitlab/-/issues/227320#note_389543891
# [3] https://gitlab.com/gitlab-org/gitlab/-/blob/23932c45096d93832189838a32b06fb3e0ff3e4e/app/services/ci/parse_dotenv_artifact_service.rb#L40
# [4] https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89403
include:
- local: '/templates/shared/stages.yml'
changed_files:
variables:
GIT_DEPTH: 0
image:
name: alpine/git
entrypoint: [""]
stage: pre
rules:
- if: $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: $CI_MERGE_REQUEST_ID
- if: $CI_PIPELINE_SOURCE == 'push'
script:
- |
if [ $CI_PIPELINE_SOURCE == "push" ]; then
echo "Push detected."
COMPARE_REF=${CI_COMMIT_BEFORE_SHA}
else
echo "MR detected."
COMPARE_REF="origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
fi
- git diff --name-only ${COMPARE_REF}...${CI_COMMIT_SHA} > changed_files.log
- echo "Changed files:"
- cat changed_files.log
artifacts:
paths:
- changed_files.log
expire_in: 1 day
include:
- local: '/templates/shared/stages.yml'
variables:
CONDA_RECIPE_DIR: conda-recipe
CONDA_OUTPUT_FOLDER: .conda-bld
CONDARC: "${CI_PROJECT_DIR}/.condarc"
CONDA_BUILD_COMMAND: build
include:
- local: 'build.yml'
- local: 'release.yml'
#
# Shared configuration.
#
# Note: this cannot be placed in a seperate file because then it will be
# included twice by GitLab in the main conda.yml file. And including
# a .yml file twice yields an error (at least with GitLab 11.9).
#
stages:
- lint
- build
- test
- quality
- release
variables:
CONDA_RECIPE_DIR: conda-recipe
CONDA_OUTPUT_FOLDER: .conda-bld
CONDARC: "${CI_PROJECT_DIR}/.condarc"
CONDA_BUILD_COMMAND: build
include:
- local: '_shared.yml'
#
# Abstract jobs
......
#
# Shared configuration.
#
# Note: this cannot be placed in a seperate file because then it will be
# included twice by GitLab in the main conda.yml file. And including
# a .yml file twice yields an error (at least with GitLab 11.9).
#
stages:
- lint
- build
- test
- quality
- release
variables:
CONDA_RECIPE_DIR: conda-recipe
CONDA_OUTPUT_FOLDER: .conda-bld
CONDARC: "${CI_PROJECT_DIR}/.condarc"
include:
- local: '_shared.yml'
#
# Release
......
stages:
- build
- test
include:
- local: '/templates/shared/stages.yml'
.abstract_pdf_job:
# Image from https://github.com/omegacen/docker-latex-builder
......
stages:
- lint
- build
- test
- quality
- release
include:
- local: '/templates/shared/stages.yml'
release_merge_and_tag:on-schedule:
stage: release
......
stages:
- pre
- lint
- build
- test
- test_post
- quality
- release
stages:
- lint
- build
- test
- quality
- release
include:
- local: '/templates/shared/stages.yml'
.abstract_sonar:
image:
......
include:
- local: '/templates/shared/stages.yml'
test_badge:
image: ${CI_REGISTRY}/${CI_PROJECT_PATH_SLUG}/testbadge:${CI_COMMIT_REF_SLUG}
stage: test_post
script:
- testbadge report.xml report.svg
artifacts:
paths:
- report.svg
expire_in: 30 days
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment