Skip to content

Commit

Permalink
ci: add openSUSE Tumbleweed
Browse files Browse the repository at this point in the history
Add an ansible task for openSUSE which will use the
configure options used by the official openSUSE package.

Signed-off-by: Michael Vetter <[email protected]>
  • Loading branch information
jubalh authored and ikerexxe committed Jan 21, 2025
1 parent 0ca7d95 commit c8e8557
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions share/ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
91 changes: 91 additions & 0 deletions share/ansible/roles/ci_run/tasks/opensuse.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions share/container-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit c8e8557

Please sign in to comment.