Skip to content

Commit

Permalink
Merge pull request #684 from gerrod3/correct-action-3.39
Browse files Browse the repository at this point in the history
Update actions to latest version and set CI python to 3.11 [3.39]
  • Loading branch information
gerrod3 authored Oct 16, 2024
2 parents d5fe381 + 33746e7 commit 8d67e84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 173 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/docs.yml

This file was deleted.

97 changes: 0 additions & 97 deletions .github/workflows/kanban.yml

This file was deleted.

75 changes: 16 additions & 59 deletions .github/workflows/pulp_images.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: pulp-oci-images CI

on:
push:
branches:
- latest
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
pull_request:
env:
Expand All @@ -24,7 +19,9 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Check commit message
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -56,16 +53,9 @@ jobs:
image_variants: "${{ steps.image_variants.outputs.image_variants }}"
pulp_ci_centos_id: "${{ steps.pulp_ci_centos_id.outputs.pulp_ci_centos_id }}"
steps:
# We do not want to build nightly images unless it's a PR to the latest branch,
# or a branch/dispatch build on the latest branch.
- name: Set the list of image_variants for later jobs
id: image_variants
run: |
if [ "${{ github.base_ref }}" == "latest" ] || [ "${{ github.ref_name }}" == "latest" ]; then
echo "image_variants=[\"nightly\",\"stable\"]" >> "$GITHUB_OUTPUT"
else
echo "image_variants=[\"stable\"]" >> "$GITHUB_OUTPUT"
fi
run: echo "image_variants=[\"stable\"]" >> "$GITHUB_OUTPUT"

- name: Set the temporary image tag
run: |
Expand All @@ -80,21 +70,13 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Update to the latest pip
run: python -m pip install --upgrade pip

- name: Dispatch workflows on stable branches
if: github.event_name == 'schedule'
run: |
echo ::group::PYDEPS
pip install gitpython requests packaging jinja2 pyyaml
echo ::endgroup::
python .ci/scripts/update_ci_branches.py
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

- name: Build images
run: |
podman version
Expand Down Expand Up @@ -123,7 +105,7 @@ jobs:
echo "pulp_ci_centos_id=${id}" >> "$GITHUB_ENV"
- name: Cache podman images
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: base-images=${{ env.pulp_ci_centos_id }}
path: base-images.tar
Expand All @@ -143,12 +125,6 @@ jobs:
- image_name: pulp
web_image: pulp-web
pip_name: pulpcore
- image_name: galaxy-minimal
web_image: galaxy-web
pip_name: galaxy-ng
- image_name: galaxy
web_image: galaxy-web
pip_name: galaxy-ng
steps:
- name: Set the temporary image tags
run: |
Expand All @@ -169,7 +145,9 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install python dependencies
if: github.event_name == 'schedule'
Expand All @@ -185,7 +163,7 @@ jobs:
fi
- name: Restore podman images from cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: base-images=${{ needs.base-images.outputs.pulp_ci_centos_id }}
path: base-images.tar
Expand Down Expand Up @@ -214,7 +192,7 @@ jobs:
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
for ARCH in arm64 amd64
do
if [[ "${{ matrix.app.image_name }}" == "pulp-minimal" || "${{ matrix.app.image_name }}" == "galaxy-minimal" ]]; then
if [[ "${{ matrix.app.image_name }}" == "pulp-minimal" ]]; then
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.core --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-${ARCH} --build-arg FROM_TAG=${TEMP_BASE_TAG}-${ARCH} .
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.webserver --tag pulp/${{ matrix.app.web_image }}:${TEMP_APP_TAG}-${ARCH} --build-arg FROM_TAG=${TEMP_APP_TAG}-${ARCH} .
else
Expand Down Expand Up @@ -249,32 +227,11 @@ jobs:
podman stop pulp
podman rm pulp
- name: Test the image in s6 mode (galaxy)
if: matrix.app.image_name == 'galaxy'
run: |
images/s6_assets/test.sh "pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-amd64" https
podman stop pulp
podman rm pulp
- name: Compose up
if: matrix.app.image_name == 'pulp-minimal'
run: |
if [[ "${{ matrix.app.image_name }}" == "pulp" || "${{ matrix.app.image_name }}" == "galaxy" ]]; then
# Reuse the folders from the s6 mode tests
FILE="compose.folders.yml"
echo "host all all 10.0.0.0/8 trust" | sudo tee -a pgsql/data/pg_hba.conf > /dev/null
echo "listen_addresses = '*'" | sudo tee -a pgsql/data/postgresql.conf > /dev/null
# We'll pull the web image from a registry since we didn't build it.
if [ "${{ matrix.image_variant }}" == "nightly" ]; then
WEB_TAG="nightly"
else
WEB_TAG="${APP_BRANCH}"
fi
else
FILE="compose.yml"
WEB_TAG="${TEMP_APP_TAG}-amd64"
fi
FILE="compose.yml"
WEB_TAG="${TEMP_APP_TAG}-amd64"
cd images/compose
sed -i "s/pulp-minimal:latest/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-amd64/g" $FILE
sed -i "s/pulp-web:latest/${{ matrix.app.web_image }}:${WEB_TAG}/g" $FILE
Expand Down

0 comments on commit 8d67e84

Please sign in to comment.