-
Notifications
You must be signed in to change notification settings - Fork 219
Al2023 CI tests #1637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Al2023 CI tests #1637
Conversation
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }} | ||
S3_REGION: ${{ vars.S3_REGION }} | ||
|
||
permissions: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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..." |
There was a problem hiding this comment.
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/ |
There was a problem hiding this comment.
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..." |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
.github/workflows/al2023_build.yml
Outdated
name: AL2023 RPM Build Tests | ||
|
||
on: | ||
pull_request: |
There was a problem hiding this comment.
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
?
.github/workflows/al2023_build.yml
Outdated
run: | | ||
mkdir -p /mnt/s3-test | ||
TEST_PREFIX="github-actions-tmp/run-${{ github.run_id }}/rpm-test/" |
There was a problem hiding this comment.
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 <tadiwaom@amazon.com>
Can you send an actions link to where it's passed in the most recent commit? |
.github/workflows/al2023_build.yml
Outdated
|
||
- name: Generate Amazon Linux 2023 spec file | ||
run: | | ||
python3 package/generate_spec.py amzn2023 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we print the spec to the Github actions step summary?
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
- name: Generate Amazon Linux 2023 spec file | ||
run: | | ||
cd package | ||
uv run python generate_spec.py amzn2023 && mv amzn2023.spec ../ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to move the output file rather than including an argument for where to write it in the first place?
|
||
- name: Generate Amazon Linux 2023 spec file | ||
run: | | ||
cd package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to use cd
here?
run: | | ||
cd package | ||
uv run python generate_spec.py amzn2023 && mv amzn2023.spec ../ | ||
echo "## Generated Amazon Linux 2023 Spec File" >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way of doing a multi-line echo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muddyfish There are 3 ways of doing that, im not sure which one you meant?
1. Heredoc
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
## Generated Amazon Linux 2023 Spec File
```spec
EOF
cat ../amzn2023.spec >> $GITHUB_STEP_SUMMARY
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
```
EOF
2. Multiline echo
echo -e "## Generated Amazon Linux 2023 Spec File\n\n\`\`\`spec" >> $GITHUB_STEP_SUMMARY
cat ../amzn2023.spec >> $GITHUB_STEP_SUMMARY
echo -e "\n\`\`\`" >> $GITHUB_STEP_SUMMARY
3. Command grouping
{
echo "## Generated Amazon Linux 2023 Spec File"
echo ""
echo '```spec'
cat ../amzn2023.spec
echo ""
echo '```'
} >> $GITHUB_STEP_SUMMARY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do something like $(cat ../amzn2023.spec)
? If so, adding that to the option 1 sounds best
- name: Install uv | ||
uses: astral-sh/setup-uv@v6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you push another rev, can you bump this to V7?
rel: #1649
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).