2018-08-30 22:39:24 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# global settings
|
2019-11-10 11:05:10 +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
|
2019-10-31 11:19:39 +00:00
|
|
|
only:
|
2019-11-11 23:27:49 +00:00
|
|
|
refs:
|
|
|
|
- merge_requests
|
2019-10-31 11:19:39 +00:00
|
|
|
changes:
|
2020-03-14 08:30:58 +00:00
|
|
|
- device/*/device-*/*
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
|
|
|
- apk -q add python3
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/check_devices_in_wiki.py --booting
|
|
|
|
|
2019-10-31 11:19:39 +00:00
|
|
|
# testcases linting
|
|
|
|
testcases-linting:
|
|
|
|
stage: first
|
|
|
|
<<: *only-default
|
|
|
|
only:
|
2019-11-11 23:27:49 +00:00
|
|
|
refs:
|
|
|
|
- merge_requests
|
2019-10-31 11:19:39 +00:00
|
|
|
changes:
|
|
|
|
- .gitlab-ci/*
|
2020-03-21 21:34:52 +00:00
|
|
|
- .gitlab-ci/*/*
|
2019-10-31 11:19:39 +00:00
|
|
|
before_script:
|
2019-11-11 22:24:39 +00:00
|
|
|
- apk -q add py-flake8
|
2019-10-31 11:19:39 +00:00
|
|
|
script:
|
|
|
|
- flake8 --ignore E501,F401,E722,W504,W605
|
|
|
|
|
|
|
|
# shellcheck
|
|
|
|
shellcheck:
|
2018-08-30 22:39:24 +00:00
|
|
|
stage: first
|
2019-02-09 21:18:00 +00:00
|
|
|
<<: *only-default
|
2019-11-10 11:05:10 +00:00
|
|
|
image: alpine:edge
|
2018-08-30 22:39:24 +00:00
|
|
|
before_script:
|
2019-11-10 11:05:10 +00:00
|
|
|
- apk -q upgrade
|
2019-10-31 11:19:39 +00:00
|
|
|
- apk -q add shellcheck
|
2018-08-30 22:39:24 +00:00
|
|
|
script:
|
2019-10-31 11:19:39 +00:00
|
|
|
- .gitlab-ci/shellcheck.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:
|
2020-04-11 20:40:32 +00:00
|
|
|
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
|
|
|
- sh ./install_pmbootstrap.sh pytest
|
2018-08-30 22:39:24 +00:00
|
|
|
script:
|
2020-03-21 15:36:38 +00:00
|
|
|
- su pmos -c ".gitlab-ci/run_testcases.sh"
|
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
|
|
|
|
|
2020-07-02 23:26:46 +00:00
|
|
|
distfile-check:
|
|
|
|
stage: first
|
|
|
|
<<: *only-default
|
|
|
|
before_script:
|
|
|
|
- apk -q add make findutils
|
|
|
|
- wget "https://gitlab.com/postmarketOS/ci-common/-/archive/master/ci-common-master.tar.bz2"
|
|
|
|
- tar -xf ci-common-master.tar.bz2
|
|
|
|
- mv ci-common-master/distfile-check/*.sh ci-common-master/distfile-check/Makefile .
|
|
|
|
- rm -r ci-common-master ci-common-master.tar.bz2
|
|
|
|
script:
|
|
|
|
- make -j999
|
|
|
|
|
2020-01-05 17:05:51 +00:00
|
|
|
# APKBUILD linting
|
|
|
|
aport-lint:
|
|
|
|
stage: first
|
2020-01-06 17:25:27 +00:00
|
|
|
before_script:
|
2020-04-06 21:06:11 +00:00
|
|
|
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
|
|
|
- sh ./install_pmbootstrap.sh
|
2020-01-05 17:05:51 +00:00
|
|
|
script:
|
2020-04-06 21:06:11 +00:00
|
|
|
- su pmos -c ".gitlab-ci/apkbuild-linting.py"
|
2020-01-05 17:05:51 +00:00
|
|
|
only:
|
|
|
|
- merge_requests
|
2020-01-13 14:01:01 +00:00
|
|
|
allow_failure: true
|
2020-01-05 17:05:51 +00:00
|
|
|
|
2019-11-12 23:28:57 +00:00
|
|
|
# kernel kconfig check
|
|
|
|
kernel-kconfig:
|
|
|
|
stage: first
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- merge_requests
|
|
|
|
changes:
|
2020-03-14 08:30:58 +00:00
|
|
|
- device/*/linux-*/config-*
|
2019-11-12 23:28:57 +00:00
|
|
|
- main/linux-*/config-*
|
|
|
|
before_script:
|
2020-04-11 20:40:32 +00:00
|
|
|
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
|
|
|
- sh ./install_pmbootstrap.sh pytest
|
2019-11-12 23:28:57 +00:00
|
|
|
script:
|
|
|
|
- su pmos -c "pmbootstrap kconfig check"
|
|
|
|
|
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:
|
2020-06-16 18:00:23 +00:00
|
|
|
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
|
|
|
|
- python3 ./check_mr_settings.py
|
2019-02-09 21:18:00 +00:00
|
|
|
|
2018-08-30 22:39:24 +00:00
|
|
|
# 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:
|
2020-04-11 20:40:32 +00:00
|
|
|
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
|
|
|
|
- sh ./install_pmbootstrap.sh
|
2018-08-30 22:39:24 +00:00
|
|
|
script:
|
2018-09-26 05:57:29 +00:00
|
|
|
- PYTHONUNBUFFERED=1 su pmos -c ".gitlab-ci/build_changed_aports.py"
|
2020-05-24 08:28:55 +00:00
|
|
|
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
|
|
|
- packages/
|