2018-08-30 22:39:24 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# global settings
|
2019-07-11 16:09:46 +00:00
|
|
|
image: alpine:latest
|
2018-08-30 22:39:24 +00:00
|
|
|
after_script:
|
|
|
|
- .gitlab-ci/move_logs.sh $CI_PROJECT_DIR
|
|
|
|
stages:
|
|
|
|
- first
|
|
|
|
- second
|
|
|
|
|
2019-02-09 21:18:00 +00:00
|
|
|
# defaults for "only"
|
|
|
|
# We need to run the CI jobs in a "merge request specific context", if CI is
|
|
|
|
# running in a merge request. Otherwise the environment variable that holds the
|
|
|
|
# merge request ID is not available. This means, we must set the "only"
|
|
|
|
# variable accordingly - and if we only do it for one job, all other jobs will
|
|
|
|
# not get executed. So have the defaults here, and use them in all jobs that
|
|
|
|
# should run on both the master branch, and in merge requests.
|
|
|
|
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
|
|
|
|
.only-default: &only-default
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- merge_requests
|
|
|
|
- tags
|
|
|
|
|
2018-08-30 22:39:24 +00:00
|
|
|
# device documentation
|
|
|
|
wiki:
|
|
|
|
stage: first
|
2019-02-09 21:18:00 +00:00
|
|
|
<<: *only-default
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
|
|
|
- apk -q add python3
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/check_devices_in_wiki.py --booting
|
|
|
|
|
|
|
|
# static code analysis (shellcheck is not in Alpine, so we use Debian)
|
|
|
|
py-sh-static:
|
|
|
|
stage: first
|
2019-02-09 21:18:00 +00:00
|
|
|
<<: *only-default
|
2018-08-30 22:39:24 +00:00
|
|
|
image: python:3.6-slim-stretch
|
|
|
|
before_script:
|
|
|
|
- apt -q update >/dev/null
|
|
|
|
- apt -y install flake8 shellcheck >/dev/null
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/static_code_analysis.sh
|
|
|
|
|
2019-06-25 06:49:34 +00:00
|
|
|
# coding style check
|
|
|
|
clang-format-static:
|
|
|
|
stage: first
|
|
|
|
<<: *only-default
|
|
|
|
before_script:
|
|
|
|
- apk -q add clang git
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/static_clang-format.sh
|
|
|
|
|
2018-08-30 22:39:24 +00:00
|
|
|
# aports checks (generic)
|
|
|
|
aports-static:
|
|
|
|
stage: first
|
2019-02-09 21:18:00 +00:00
|
|
|
<<: *only-default
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
|
|
|
- .gitlab-ci/install_pmbootstrap.sh pytest
|
|
|
|
script:
|
2019-05-19 20:20:39 +00:00
|
|
|
- apk -q add git
|
2019-02-09 20:15:06 +00:00
|
|
|
- su pmos -c "pmbootstrap kconfig check"
|
2018-08-30 22:39:24 +00:00
|
|
|
- su pmos -c ".gitlab-ci/run_testcases.sh
|
|
|
|
-m 'not pmaports_upstream_compat'"
|
2019-05-19 20:20:39 +00:00
|
|
|
- su pmos -c ".gitlab-ci/check_changed_aports_versions.py"
|
2018-08-30 22:39:24 +00:00
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- log.txt
|
|
|
|
- log_testsuite_pmaports.txt
|
|
|
|
- pmbootstrap.cfg
|
|
|
|
expire_in: 1 week
|
|
|
|
|
2019-02-09 21:18:00 +00:00
|
|
|
# MR settings
|
|
|
|
# (Checks for "Allow commits from members who can merge to the target branch")
|
|
|
|
mr-settings:
|
|
|
|
stage: first
|
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
before_script:
|
|
|
|
- apk -q add python3
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/check_mr_settings.py
|
|
|
|
|
2018-08-30 22:39:24 +00:00
|
|
|
# aports checks (upstream compatibility)
|
|
|
|
aports-static-upstream:
|
|
|
|
stage: second
|
2019-02-09 21:18:00 +00:00
|
|
|
only:
|
|
|
|
- master@postmarketOS/pmaports
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
|
|
|
- .gitlab-ci/install_pmbootstrap.sh pytest
|
|
|
|
script:
|
|
|
|
- su pmos -c ".gitlab-ci/run_testcases.sh
|
|
|
|
-m 'pmaports_upstream_compat'"
|
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- log.txt
|
|
|
|
- log_testsuite_pmaports.txt
|
|
|
|
- pmbootstrap.cfg
|
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
# build changed aports
|
|
|
|
aports-build:
|
|
|
|
stage: second
|
2019-02-09 21:18:00 +00:00
|
|
|
<<: *only-default
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
|
|
|
- .gitlab-ci/install_pmbootstrap.sh git
|
|
|
|
script:
|
2018-09-26 05:57:29 +00:00
|
|
|
- PYTHONUNBUFFERED=1 su pmos -c ".gitlab-ci/build_changed_aports.py"
|