CI: only run Debian'ish commands on jobs run on Debian'ish systems

This commit is contained in:
intrigeri 2022-02-13 12:26:19 +00:00
parent 2a7bd3aa9e
commit 9f8c0d25e3

View file

@ -1,11 +1,5 @@
--- ---
image: ubuntu:latest image: ubuntu:latest
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq
- apt-get install --no-install-recommends -y gcc perl liblocale-gettext-perl linux-libc-dev lsb-release make
- lsb_release -a
- uname -a
# XXX - add a deploy stage to publish man pages, docs, and coverage # XXX - add a deploy stage to publish man pages, docs, and coverage
# reports # reports
@ -14,11 +8,21 @@ stages:
- build - build
- test - test
.ubuntu-before_script:
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq
- apt-get install --no-install-recommends -y gcc perl liblocale-gettext-perl linux-libc-dev lsb-release make
- lsb_release -a
- uname -a
.install-c-build-deps: &install-c-build-deps .install-c-build-deps: &install-c-build-deps
- apt-get install --no-install-recommends -y build-essential apache2-dev autoconf automake bison dejagnu flex libpam-dev libtool pkg-config python3-all-dev python3-setuptools ruby-dev swig zlib1g-dev - apt-get install --no-install-recommends -y build-essential apache2-dev autoconf automake bison dejagnu flex libpam-dev libtool pkg-config python3-all-dev python3-setuptools ruby-dev swig zlib1g-dev
build-all: build-all:
stage: build stage: build
extends:
- .ubuntu-before_script
artifacts: artifacts:
name: ${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} name: ${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 30 days expire_in: 30 days
@ -44,6 +48,8 @@ build-all:
test-libapparmor: test-libapparmor:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- *install-c-build-deps - *install-c-build-deps
- make -C libraries/libapparmor check - make -C libraries/libapparmor check
@ -51,6 +57,8 @@ test-libapparmor:
test-parser: test-parser:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- *install-c-build-deps - *install-c-build-deps
- make -C parser check - make -C parser check
@ -58,12 +66,16 @@ test-parser:
test-binutils: test-binutils:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- make -C binutils check - make -C binutils check
test-utils: test-utils:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- apt-get install --no-install-recommends -y libc6-dev libjs-jquery libjs-jquery-throttle-debounce libjs-jquery-isonscreen libjs-jquery-tablesorter pyflakes3 python3-coverage python3-notify2 python3-psutil - apt-get install --no-install-recommends -y libc6-dev libjs-jquery libjs-jquery-throttle-debounce libjs-jquery-isonscreen libjs-jquery-tablesorter pyflakes3 python3-coverage python3-notify2 python3-psutil
# See apparmor/apparmor#221 # See apparmor/apparmor#221
@ -79,12 +91,16 @@ test-utils:
test-mod-apparmor: test-mod-apparmor:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- make -C changehat/mod_apparmor check - make -C changehat/mod_apparmor check
test-profiles: test-profiles:
stage: test stage: test
needs: ["build-all"] needs: ["build-all"]
extends:
- .ubuntu-before_script
script: script:
- make -C profiles check-parser - make -C profiles check-parser
- make -C profiles check-abstractions.d - make -C profiles check-abstractions.d
@ -92,6 +108,8 @@ test-profiles:
shellcheck: shellcheck:
stage: test stage: test
needs: [] needs: []
extends:
- .ubuntu-before_script
script: script:
- apt-get install --no-install-recommends -y file shellcheck xmlstarlet - apt-get install --no-install-recommends -y file shellcheck xmlstarlet
- shellcheck --version - shellcheck --version