Skip to content

Conversation

tadiwa-aizen
Copy link
Contributor

What changed and why?
This PR adds a new GitHub Actions workflow that automatically tests RPM package builds for Amazon Linux 2023. The workflow creates both source and binary RPMs using mock in a clean AL2023 container environment, then validates the installation and basic functionality of the mount-s3 package. It includes end-to-end testing by actually mounting an S3 bucket and performing file operations to ensure the RPM works correctly. This ensures that RPM packages built for Amazon Linux 2023 are properly tested in CI before release, catching any packaging or compatibility issues early.

Does this change impact existing behavior?

Added more tests, for al2023 build compatibility

Does this change need a changelog entry? Does it require a version change?

No, just CI tests for al2023 intergration


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

Signed-off-by: Tadiwa Magwenzi <[email protected]>
@tadiwa-aizen tadiwa-aizen temporarily deployed to PR integration tests October 7, 2025 21:21 — with GitHub Actions Inactive
Signed-off-by: Tadiwa Magwenzi <[email protected]>
@tadiwa-aizen tadiwa-aizen requested a deployment to PR integration tests October 8, 2025 08:24 — with GitHub Actions Waiting
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_REGION: ${{ vars.S3_REGION }}

permissions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we move these above the env section?

cd $GITHUB_WORKSPACE
cd package
python3 generate_spec.py amzn2023
ls -la amzn2023-packaging.spec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here?


- name: Generate Amazon Linux 2023 spec file
run: |
cd $GITHUB_WORKSPACE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge the cd commands

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there should be quotes surrounding usage of environment variables

run: |
cd $GITHUB_WORKSPACE

echo " Extracting version from spec file..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this many echo statements?


cp package/amzn2023-packaging.spec ~/rpmbuild/SPECS/

cp LICENSE ~/rpmbuild/SOURCES/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can all be merged together

cp THIRD_PARTY_LICENSES ~/rpmbuild/SOURCES/
echo "RPM Sources created"

echo " Creating source tarball..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dance here is confusing - it's not obvious where our cwd is at any given point

run: |
# https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
echo "y" | dnf install sudo
chmod 0400 /etc/shadow || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why || true?

- name: Avoid PAM issues by installing sudo interactively
run: |
# https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
echo "y" | dnf install sudo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dnf install -y

run: |
echo " Building binary RPM for version: $VERSION"

sudo mock -r amazonlinux-2023-x86_64 --clean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to run clean before the initial build?

Signed-off-by: Tadiwa Magwenzi <[email protected]>
@tadiwa-aizen tadiwa-aizen temporarily deployed to PR integration tests October 8, 2025 19:20 — with GitHub Actions Inactive
Signed-off-by: Tadiwa Magwenzi <[email protected]>
Signed-off-by: Tadiwa Magwenzi <[email protected]>
name: AL2023 RPM Build Tests

on:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we remove pull_request_target?

run: |
mkdir -p /mnt/s3-test

TEST_PREFIX="github-actions-tmp/run-${{ github.run_id }}/rpm-test/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this part of the Github environment at the top?

Signed-off-by: Tadiwa Magwenzi <[email protected]>
@muddyfish
Copy link
Contributor

Can you send an actions link to where it's passed in the most recent commit?


- name: Generate Amazon Linux 2023 spec file
run: |
python3 package/generate_spec.py amzn2023
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Tadiwa Magwenzi <[email protected]>
Signed-off-by: Tadiwa Magwenzi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants