Skip to content

Fix 3.21 CI

Fix 3.21 CI #847

name: Build OCI Images
on:
- pull_request
env:
COLORTERM: 'yes'
TERM: 'xterm-256color'
PYTEST_ADDOPTS: '--color=yes'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Check commit message
if: github.event_name == 'pull_request'
env:
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: |
echo ::group::REQUESTS
pip install pygithub
echo ::endgroup::
for sha in $(curl $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
do
python .ci/scripts/validate_commit_message.py $sha
VALUE=$?
if [ "$VALUE" -gt 0 ]; then
exit $VALUE
fi
done
shell: bash
build:
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
include:
- test_image: pulp-galaxy-ng
tag: "4.6"
- test_image: pulp
tag: "3.21"
- test_image: pulp-galaxy-ng
tag: "4.6-https"
- test_image: pulp
tag: "3.21-https"
steps:
- uses: actions/checkout@v4
- name: Set https build args
if: contains(fromJSON('["4.6-https", "3.21-https"]'), matrix.tag)
run: |
echo "BUILD_ARG=--build-arg SCHEME=https" >> $GITHUB_ENV
echo "TEST_ARG=https" >> $GITHUB_ENV
- name: Build the images
run: |
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-x86_64.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-noarch.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-symlinks-arch.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-symlinks-noarch.tar.xz
unxz s6-overlay*.tar.xz
gzip s6-overlay*.tar
LOCATION="${{ matrix.test_image }}"
docker build --file s6_images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${{ matrix.tag }} . ${{ env.BUILD_ARG }}
docker build --file "s6_images/${LOCATION//-/_}/Containerfile" --tag pulp/${{ matrix.test_image }}:${{ matrix.tag }} . --build-arg FROM_TAG=${{ matrix.tag }}
- name: Test the images
run: s6_images/assets/test.sh "pulp/${{ matrix.test_image }}:${{ matrix.tag }}" ${{ env.TEST_ARG }}
- name: Display log on error
if: failure()
run: docker logs pulp