This git repository contains the configuration used to build the docker image used in CI tests. The resulting docker image is available at https://registry.opensuse.org/.
- The image is rebuilt whenever a commit it pushed to the
masterbranch. - The submit.yml GitHub Action commits the configuration to the YaST:Head/ci-ruby-container
- The OBS tracks the dependencies and rebuilds the image if any dependant package is updated.
If for some reason the automatic rebuild do not work or it failed you can trigger the rebuild in the OBS just like for the other regular packages.
This image is based on the latest openSUSE Tumbleweed image, additionally it contains the packages needed for running the tests for YaST packages written in Ruby. It is possible to install additional packagers if needed, see the Examples section below.
The image contains the yast-ci-ruby script which runs all the checks and tests.
The workflow is:
- Copy the sources into the
/usr/src/appdirectory. - If the code needs additional packages install them using the
zypper installcommand from the localDockerfile. If the package can be used by more modules you can add it into the base Docker image here. - Run the
yast-ci-rubyscript. (Optionally you can use the-xand-ooptions to split the work into several smaller tasks and run them in parallel.)
Save as .github/workflows/ci.yml file in your Git repository:
# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI
on: [push, pull_request]
jobs:
Package:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
# optional, remove if not needed
- name: Prepare System
run: |
zypper --non-interactive in --no-recommends \
needed-package1 \
needed-package2
- name: Package Build
run: yast-ci-rubyFrom the Git sources:
# you need the rubygem-yast-rake package installed
rake osc:buildFrom the OBS checkout:
# check it out if not already present
osc co YaST:Head/ci-ruby-container
cd YaST:Head/ci-ruby-container
# build it
osc build containers️:warning: This approach is not 100% the same as building the image with osc described above.
The osc build injects some special modifications to allow building the image inside
the OBS build environment.
ℹ️️ You should prefer using the osc method if possible, use the docker
build only as a fallback when the osc build is not possible or does not work in your environment.
docker build -t ci-ruby-container-test -f package/Dockerfile package/