diff --git a/.zuul.yaml b/.zuul.yaml index 1ec2f5973..1543b8a04 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -7,6 +7,7 @@ nodes: - name: ci-node-33 label: cloud-fedora-33-small + pre-run: playbooks/setup-env.yaml run: playbooks/unit-test.yaml - job: diff --git a/playbooks/setup-env.yaml b/playbooks/setup-env.yaml index 7ac9b46ee..460ca9977 100644 --- a/playbooks/setup-env.yaml +++ b/playbooks/setup-env.yaml @@ -40,3 +40,21 @@ - name: Show podman debug information command: podman info --debug + + - name: Set up build directory + command: meson builddir + args: + chdir: '{{ zuul.project.src_dir }}' + + - name: Build Toolbox + command: ninja -C builddir + args: + chdir: '{{ zuul.project.src_dir }}' + creates: builddir/src/toolbox + + - name: Install Toolbox + become: yes + command: ninja -C builddir install + args: + chdir: '{{ zuul.project.src_dir }}' + creates: /usr/local/bin/toolbox diff --git a/playbooks/system-test.yaml b/playbooks/system-test.yaml index c2eff3f0d..0249548ac 100644 --- a/playbooks/system-test.yaml +++ b/playbooks/system-test.yaml @@ -1,32 +1,10 @@ --- - hosts: all - - vars: - toolbox_bin: '/usr/local/bin/toolbox' - tasks: - - name: Set up build directory - command: meson builddir - args: - chdir: '{{ zuul.project.src_dir }}' - - - name: Build Toolbox - command: ninja -C builddir - args: - chdir: '{{ zuul.project.src_dir }}' - creates: builddir/src/toolbox - - - name: Install Toolbox - become: yes - command: ninja -C builddir install - args: - chdir: '{{ zuul.project.src_dir }}' - creates: '{{ toolbox_bin }}' - - name: Run system tests command: bats --timing ./test/system environment: PODMAN: '/usr/bin/podman' - TOOLBOX: '{{ toolbox_bin }}' + TOOLBOX: '/usr/local/bin/toolbox' args: chdir: '{{ zuul.project.src_dir }}' diff --git a/playbooks/unit-test.yaml b/playbooks/unit-test.yaml index 9be98e7bd..2212521c5 100644 --- a/playbooks/unit-test.yaml +++ b/playbooks/unit-test.yaml @@ -1,27 +1,6 @@ --- - hosts: all tasks: - - name: Install requirements - become: yes - package: - name: - - golang - - golang-github-cpuguy83-md2man - - ninja-build - - meson - - ShellCheck - - - name: Set up build directory - command: meson builddir - args: - chdir: '{{ zuul.project.src_dir }}' - - - name: Build Toolbox - command: ninja -C builddir - args: - chdir: '{{ zuul.project.src_dir }}' - creates: builddir/src/toolbox - - name: Test command: ninja -C builddir test args: