Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add docker build #1555

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM registry.fedoraproject.org/fedora:rawhide

RUN dnf -y install fedpkg tito argparse-manpage bash-completion python3-devel python3-jsonschema python3-pytest
RUN useradd -m -G mock -u 1001 user
WORKDIR /home/user

COPY mock/ /home/user/mock
RUN chown -R user:user /home/user/mock
USER user
WORKDIR /home/user/mock/mock-core-configs
RUN tito build --rpm
WORKDIR /home/user/mock/mock
RUN tito build --test --rpm
USER root
RUN dnf -y install --allow-downgrade /tmp/tito/*/mock*.rpm
USER user
26 changes: 26 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: dockertest
on:
push:
pull_request:

jobs:
dockertest:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout mock
uses: actions/checkout@v4
with:
path: mock
fetch-depth: 0
- name: Build new image with mock in it and Load it into Docker for testing
uses: docker/build-push-action@v6
with:
tags: mockenv:latest
file: mock/.github/workflows/Dockerfile
context: .
pull: true
push: false
load: true
- run: docker run --privileged --cap-add=SYS_ADMIN -t --rm mockenv:latest sh -c "mock --shell echo hello world"
Loading