generated from amazon-archives/__template_Apache-2.0
-
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
Draft
tadiwa-aizen
wants to merge
10
commits into
awslabs:main
Choose a base branch
from
tadiwa-aizen:al2023-ci-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Al2023 CI tests #1637
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fe27ee9
Al2023 CI tests
tadiwa-aizen fd6616f
Formatting updates
tadiwa-aizen 8a9fa18
AL2023 CI Build
tadiwa-aizen 3ae79a7
AL2023 CI Updates
tadiwa-aizen 95a94aa
AL2023 CI test cleaup updates
tadiwa-aizen 4a0adf0
AL2023 CI Adjustments
tadiwa-aizen c33224f
CI sumamry spec
tadiwa-aizen 61f9691
CI Updates
tadiwa-aizen 0a308f6
AL2023 CI Updates
tadiwa-aizen 602c423
CI Updates
tadiwa-aizen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: AL2023 RPM Build Tests | ||
|
||
on: | ||
pull_request_target: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }} | ||
S3_REGION: ${{ vars.S3_REGION }} | ||
TEST_PREFIX: "github-actions-tmp/run-${{ github.run_id }}/rpm-test/" | ||
|
||
jobs: | ||
al2023-package-test: | ||
name: Amazon Linux 2023 RPM Build and Test | ||
runs-on: ubuntu-latest | ||
container: | ||
image: amazonlinux:2023 | ||
options: --privileged | ||
|
||
steps: | ||
- name: Install build tools and dependencies | ||
run: | | ||
dnf -y install git rpm-build rpmdevtools make mock ca-certificates python3 rust cargo sudo awscli | ||
cargo install cargo-about | ||
|
||
- name: Preventing container PAM sudo errors | ||
run: | | ||
# https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6 | ||
chmod 0400 /etc/shadow | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v5 | ||
with: | ||
role-to-assume: ${{ vars.ACTIONS_IAM_ROLE }} | ||
aws-region: ${{ vars.S3_REGION }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v5 | ||
with: | ||
submodules: true | ||
persist-credentials: false | ||
|
||
- name: Generate Amazon Linux 2023 spec file | ||
run: | | ||
python3 package/generate_spec.py amzn2023 | ||
|
||
|
||
- name: Build source tarball and SRPM | ||
run: | | ||
VERSION=$(awk '/^Version:/ {print $2}' amzn2023.spec) | ||
cargo vendor | ||
cargo about generate --config package/attribution.toml --output-file THIRD_PARTY_LICENSES package/attribution.hbs | ||
rpmdev-setuptree | ||
|
||
cp amzn2023.spec ~/rpmbuild/SPECS/ | ||
cp LICENSE NOTICE THIRD_PARTY_LICENSES ~/rpmbuild/SOURCES | ||
|
||
cd .. | ||
tar -czf "mountpoint-s3-${VERSION}.tar.gz" mountpoint-s3 | ||
cp "mountpoint-s3-${VERSION}.tar.gz" ~/rpmbuild/SOURCES/ | ||
rpmbuild -bs ~/rpmbuild/SPECS/amzn2023.spec | ||
echo "VERSION=${VERSION}" >> "$GITHUB_ENV" | ||
|
||
- name: Test RPM build with Mock in Amazon Linux 2023 chroot | ||
run: | | ||
sudo mock -r amazonlinux-2023-x86_64 --rebuild ~/rpmbuild/SRPMS/mount-s3-${VERSION}-amzn2023.src.rpm | ||
muddyfish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Test RPM installation | ||
run: | | ||
dnf -y install /var/lib/mock/amazonlinux-2023-x86_64/result/mount-s3-${VERSION}-amzn2023.x86_64.rpm | ||
which mount-s3 | ||
mount-s3 --version | ||
mount-s3 --help | ||
|
||
- name: Basic Functionality Tests | ||
run: | | ||
mkdir -p /mnt/s3-test | ||
|
||
# Read Test | ||
echo "Hello from RPM test" | aws s3 cp - "s3://${S3_BUCKET_NAME}/${TEST_PREFIX}test.txt" | ||
mount-s3 "${S3_BUCKET_NAME}" /mnt/s3-test --prefix="${TEST_PREFIX}" --region="${S3_REGION}" | ||
cat /mnt/s3-test/test.txt | grep -q "Hello from RPM test" | ||
|
||
# Write Test | ||
echo "Hello from RPM write test" > /mnt/s3-test/write-test.txt | ||
aws s3 cp "s3://${S3_BUCKET_NAME}/${TEST_PREFIX}write-test.txt" - | grep -q "Hello from RPM write test" | ||
|
||
sudo umount /mnt/s3-test | ||
|
||
- name: Cleanup test resources | ||
if: always() | ||
run: | | ||
aws s3 rm "s3://${S3_BUCKET_NAME}/${TEST_PREFIX}test.txt" | ||
aws s3 rm "s3://${S3_BUCKET_NAME}/${TEST_PREFIX}write-test.txt" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.