diff --git a/.circleci/config.yml b/.circleci/config.yml index 02698110c..964d0349a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,21 @@ -# TODO: use matrix to test different build options and linux distros version: 2.1 jobs: build: + description: Configure, build and package sudo + parameters: + ldap: + description: if true, build sudo's LDAP support + default: false + type: boolean + static_sudoers: + description: if true, build sudoers statically + default: false + type: boolean + logsrvd: + description: if true, build sudo_logsrvd and sudoers client + default: true + type: boolean docker: - image: docker.io/sudoproject/ubuntu:latest user: build @@ -10,13 +23,14 @@ jobs: - checkout - run: name: "Building and packaging sudo" - command: ./scripts/mkpkg --flavor=ldap --enable-warnings --enable-werror --enable-sanitizer + command: ./scripts/mkpkg <<# parameters.ldap >>--flavor=ldap --with-sssd --with-sssd-lib=/usr/lib/x86_64-linux-gnu <><<^ parameters.logsrvd >>--disable-log-server --disable-log-client <><<# parameters.static_sudoers >>--enable-static-sudoers <>--enable-warnings --enable-werror --enable-sanitizer # Save workspace for subsequent jobs (i.e. test) - persist_to_workspace: root: . paths: - . test: + description: run sudo tests in a pre-built workspace docker: - image: docker.io/sudoproject/ubuntu:latest user: build @@ -37,14 +51,32 @@ workflows: build_and_test: jobs: - build: - # Only build the "main" branch + name: build-ldap + ldap: true + filters: + branches: + only: main + - build: + name: build-static-sudoers + static_sudoers: true + filters: + branches: + only: main + - build: + name: build-nologsrvd + logsrvd: false filters: branches: only: main - test: - filters: - # Only test the "main" branch - branches: - only: main + name: test-ldap requires: - - build + - build-ldap + - test: + name: test-static-sudoers + requires: + - build-static-sudoers + - test: + name: test-nologsrvd + requires: + - build-nologsrvd