test: add github test environment action
Create a github action that accepts any command with args and runs it in a container that is prepared with all the dependencies for koji (hub, builder, command line), so all tests, like pylint or unit tests can run in it.
This commit is contained in:
parent
0180bce383
commit
734d039089
3 changed files with 39 additions and 0 deletions
21
test/Dockerfile
Normal file
21
test/Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM docker.io/library/fedora:latest
|
||||
|
||||
RUN dnf -y upgrade \
|
||||
&& dnf -y \
|
||||
--setopt=fastestmirror=True \
|
||||
--setopt=install_weak_deps=False \
|
||||
install \
|
||||
koji-builder \
|
||||
koji-hub \
|
||||
koji-utils \
|
||||
koji \
|
||||
postgresql \
|
||||
pylint \
|
||||
python3-flexmock \
|
||||
python3-jsonschema \
|
||||
python3-koji \
|
||||
&& dnf clean all
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
12
test/action.yml
Normal file
12
test/action.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
name: 'Koji plugin test environment'
|
||||
description: 'Environment prepared for running koji plugin tests'
|
||||
inputs:
|
||||
run:
|
||||
description: 'What to run'
|
||||
required: true
|
||||
default: 'echo "Nothing to do"'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.run }}
|
||||
6
test/entrypoint.sh
Executable file
6
test/entrypoint.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh -l
|
||||
set -euo pipefail
|
||||
|
||||
cd $GITHUB_WORKSPACE
|
||||
|
||||
/bin/bash -o errexit -c "$1"
|
||||
Loading…
Add table
Add a link
Reference in a new issue