73b1a493b9
See similar patch in pmbootstrap for rationale:
27618d5ffd
W504 ignore is removed as the rule does not exist in Ruff. But, since it
was ignored anyway, this does not matter.
168 lines
3.3 KiB
YAML
168 lines
3.3 KiB
YAML
---
|
|
|
|
# global settings
|
|
image: alpine:edge
|
|
after_script:
|
|
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
|
|
stages:
|
|
- lint
|
|
- build
|
|
|
|
# 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
|
|
|
|
# device documentation
|
|
wiki:
|
|
stage: lint
|
|
<<: *only-default
|
|
only:
|
|
refs:
|
|
- merge_requests
|
|
changes:
|
|
- device/*/device-*/*
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/wiki.sh
|
|
|
|
# testcases linting
|
|
ruff:
|
|
stage: lint
|
|
<<: *only-default
|
|
only:
|
|
refs:
|
|
- merge_requests
|
|
changes:
|
|
- .ci/*
|
|
- .ci/*/*
|
|
before_script:
|
|
- "echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories"
|
|
- apk -q add ruff
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/ruff.sh
|
|
|
|
# shellcheck and various grep checks
|
|
shellcheck-grep:
|
|
stage: lint
|
|
<<: *only-default
|
|
image: alpine:edge
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/shellcheck.sh
|
|
- .ci/grep.sh
|
|
- .ci/codeowners.sh
|
|
|
|
editor-config:
|
|
stage: lint
|
|
<<: *only-default
|
|
image: alpine:edge
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/ec.sh
|
|
|
|
# aports checks (generic)
|
|
pytest-commits:
|
|
stage: lint
|
|
<<: *only-default
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/pytest.sh
|
|
- .ci/commits.sh
|
|
artifacts:
|
|
when: on_failure
|
|
paths:
|
|
- log.txt
|
|
- log_testsuite_pmaports.txt
|
|
- pmbootstrap.cfg
|
|
expire_in: 1 week
|
|
|
|
# APKBUILD linting
|
|
aport-lint:
|
|
stage: lint
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/apkbuild-lint.sh
|
|
only:
|
|
- merge_requests
|
|
allow_failure: true
|
|
|
|
# kernel kconfig check
|
|
kernel-kconfig:
|
|
stage: lint
|
|
only:
|
|
refs:
|
|
- master
|
|
- merge_requests
|
|
changes:
|
|
- device/*/linux-*/config-*
|
|
- main/linux-*/config-*
|
|
script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
- .ci/kconfig.sh
|
|
|
|
# MR settings
|
|
# (Checks for "Allow commits from members who can merge to the target branch")
|
|
mr-settings:
|
|
stage: lint
|
|
only:
|
|
- merge_requests
|
|
before_script:
|
|
- apk -q add python3
|
|
script:
|
|
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
|
|
- python3 ./check_mr_settings.py
|
|
|
|
# build changed aports
|
|
.build:
|
|
stage: build
|
|
<<: *only-default
|
|
before_script:
|
|
- .ci/lib/gitlab_prepare_ci.sh
|
|
after_script:
|
|
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
|
|
artifacts:
|
|
expire_in: 1 week
|
|
paths:
|
|
- packages/
|
|
timeout: 10 h
|
|
|
|
build-x86_64:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-x86_64.sh
|
|
|
|
build-x86:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-x86.sh
|
|
|
|
build-aarch64:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-aarch64.sh
|
|
|
|
build-armv7:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-armv7.sh
|
|
|
|
build-armhf:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-armhf.sh
|
|
|
|
build-riscv64:
|
|
extends: .build
|
|
script:
|
|
- .ci/build-riscv64.sh
|