mirror of
https://github.com/coreos/fedora-coreos-config.git
synced 2026-02-05 09:45:30 +01:00
71 lines
2.7 KiB
YAML
71 lines
2.7 KiB
YAML
name: Container-native
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [testing-devel]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
podman_build:
|
|
name: Podman Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
# cargo-culted from rpm-ostree CI
|
|
# https://github.com/containers/podman/discussions/17362
|
|
- name: Get newer podman
|
|
run: |
|
|
set -xeuo pipefail
|
|
echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
|
|
sudo apt update
|
|
sudo apt install -y crun/testing podman/testing skopeo/testing
|
|
# Something is confused in latest GHA here
|
|
sudo rm /var/lib/containers -rf
|
|
- name: Download override packages and create yum repo
|
|
run: |
|
|
podman run --rm -v $PWD:/run/src -w /run/src quay.io/fedora/fedora:latest sh -c '
|
|
set -xeuo pipefail
|
|
dnf -y install koji createrepo_c python3-dnf python3-PyYAML && dnf clean all
|
|
workdir="/run/src"
|
|
overridesdir="rpmoverrides"
|
|
|
|
# prepare directory to download override packages
|
|
[ -d ${overridesdir} ] && rm -rf ${overridesdir}
|
|
mkdir -p "${overridesdir}"
|
|
|
|
curl -LO https://raw.githubusercontent.com/coreos/coreos-assembler/refs/heads/main/src/download-overrides.py
|
|
python3 download-overrides.py --downloaddir "./${overridesdir}" --lockfiledir "./"
|
|
|
|
# create local yum repo
|
|
if [[ -n $(ls "${overridesdir}/"*.rpm 2> /dev/null) ]]; then
|
|
cd "${overridesdir}" && createrepo_c .
|
|
cat > "${workdir}"/local-overrides.repo <<EOF
|
|
[local-overrides]
|
|
name=local-overrides
|
|
baseurl=file://${workdir}/${overridesdir}/
|
|
enabled=1
|
|
gpgcheck=0
|
|
cost=500
|
|
EOF
|
|
else
|
|
# remove empty dir rpmoverrides
|
|
rmdir "${workdir}/${overridesdir}/"
|
|
fi
|
|
rm "${workdir}"/download-overrides.py
|
|
'
|
|
- name: Build
|
|
# Note: we should be able to drop the `-v $PWD:/run/src` once
|
|
# https://github.com/containers/buildah/issues/5952 is fixed.
|
|
run: |
|
|
set -xeuo pipefail
|
|
SECRETS=()
|
|
if [[ -f local-overrides.repo ]]; then
|
|
SECRETS+=(--secret id=yumrepos,src=local-overrides.repo)
|
|
fi
|
|
podman build "${SECRETS[@]}" --security-opt=label=disable --cap-add=all --device /dev/fuse --build-arg-file build-args.conf -v $PWD:/run/src . -t localhost/fedora-coreos
|
|
- name: Sanity-check
|
|
run: podman run --rm localhost/fedora-coreos echo hello
|