]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
ci: add openSUSE Tumbleweed
authorMichael Vetter <jubalh@iodoru.org>
Mon, 20 Jan 2025 10:13:54 +0000 (11:13 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 21 Jan 2025 12:09:24 +0000 (13:09 +0100)
Add an ansible task for openSUSE which will use the
configure options used by the official openSUSE package.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
.github/workflows/runner.yml
share/ansible/playbook.yml
share/ansible/roles/ci_run/tasks/opensuse.yml [new file with mode: 0644]
share/container-build.sh

index ac6440d22efa9abbcba9283ec9bb6a4d0bc45964..18fca18e7f5c4c087985587e824b62e1b0ae4640 100644 (file)
@@ -71,7 +71,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [alpine, debian, fedora]
+        os: [alpine, debian, fedora, opensuse]
 
     steps:
     - uses: actions/setup-python@v5
index 06fb6e48ff39b57ddad129fa4d2190e2c9164327..86d1afd8b5e77c4db9aa6eb77e0babdb74f1d334 100644 (file)
@@ -5,6 +5,7 @@
       fedora: registry.fedoraproject.org/fedora:latest
       alpine: docker.io/library/alpine:latest
       debian: docker.io/library/debian:latest
+      opensuse: docker.io/opensuse/tumbleweed:latest
 
   roles:
     - role: build_container
diff --git a/share/ansible/roles/ci_run/tasks/opensuse.yml b/share/ansible/roles/ci_run/tasks/opensuse.yml
new file mode 100644 (file)
index 0000000..ab16580
--- /dev/null
@@ -0,0 +1,91 @@
+---
+# tasks file for ci_run
+- name: Ensure python is installed
+  ansible.builtin.raw: zypper --non-interactive in python3
+
+- name: Ensure dependencies are installed
+  community.general.zypper:
+    name:
+      - autoconf
+      - automake
+      - byacc
+      - diffutils
+      - gawk
+      - gcc
+      - gettext-tools
+      - intltool
+      - libcmocka-devel
+      - libtool
+      - libxslt-tools
+      - make
+      - systemd-devel
+    state: present
+
+# Needed to use `zypper si`
+- name: Enable all repos
+  ansible.builtin.command:
+    zypper --non-interactive mr -ea
+
+- name: Ensure build dependencies are installed
+  ansible.builtin.command:
+    zypper --non-interactive si -d shadow
+  register: zypper_result
+  changed_when: '"Nothing to do" not in zypper_result.stdout'
+
+- name: Build configuration
+  ansible.builtin.command: >
+    ./autogen.sh
+    --enable-account-tools-setuid
+    --enable-shadowgrp
+    --with-acl
+    --with-attr
+    --with-audit
+    --with-group-name-max-length=32
+    --with-libpam
+    --with-nscd
+    --with-selinux
+    --with-sha-crypt
+    --without-libbsd
+    --without-libcrack
+    --without-sssd
+  args:
+    chdir: /usr/local/src/shadow/
+  ignore_errors: true
+
+- name: Build
+  ansible.builtin.shell:
+    make -Orecurse -j4 > build.log
+  args:
+    chdir: /usr/local/src/shadow/
+  ignore_errors: true
+
+- name: Run unit-tests
+  ansible.builtin.command:
+    make check
+  args:
+    chdir: /usr/local/src/shadow/
+  ignore_errors: true
+
+- name: Install
+  ansible.builtin.command:
+    make install
+  args:
+    chdir: /usr/local/src/shadow/
+  ignore_errors: true
+
+- name: Copy logs
+  ansible.builtin.fetch:
+    src: '{{ item }}'
+    dest: ./build-out/
+    flat: yes
+  with_items:
+    - "/usr/local/src/shadow/config.log"
+    - "/usr/local/src/shadow/config.h"
+    - "/usr/local/src/shadow/build.log"
+    - "/usr/local/src/shadow/tests/unit/test-suite.log"
+
+- name: Copy configuration file for testing
+  ansible.builtin.copy:
+    src: /usr/local/src/shadow/tests/system/etc/login.defs
+    dest: /etc/login.defs
+    remote_src: yes
index 0116c17d3e9d7df3873526191e01bd3e981d17c2..a0d81eccea54020179f904a47818671301703a30 100755 (executable)
@@ -12,3 +12,4 @@ cd share/ansible/
 ansible-playbook playbook.yml -i inventory.ini -e 'distribution=alpine'
 ansible-playbook playbook.yml -i inventory.ini -e 'distribution=debian'
 ansible-playbook playbook.yml -i inventory.ini -e 'distribution=fedora'
+ansible-playbook playbook.yml -i inventory.ini -e 'distribution=opensuse'