Skip to content

almalinux-compose-test-arm64 #32

almalinux-compose-test-arm64

almalinux-compose-test-arm64 #32

name: almalinux-compose-test-arm64
on:
workflow_dispatch:
inputs:
version_major:
description: 'AlmaLinux major version'
required: true
default: '9'
type: choice
options:
- 9
- 8
pungi_repository:
description: 'Add AlmaLinux pungi repositories'
type: boolean
pulp_repository:
description: 'Add AlmaLinux pulp repositories'
type: boolean
jobs:
start-runner:
name: Setup and start self-hosted EC2 runner
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: bitovi/[email protected]
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_default_region: ${{ secrets.AWS_REGION }}
# additional_tags: '{\"key\":\"value\",\"key2\":\"value2\"}'
aws_ec2_instance_type: t4g.small
aws_ec2_ami_id: ${{ inputs.version_major == '9' && 'ami-0ce12a8fbc3cc15a5' || 'ami-01e3e647c7acbc64b' }}
# aws_ec2_security_group_name: sg-07e22182e33675edc
# aws_vpc_subnet_id: subnet-64063c29
aws_vpc_create: false
repo_access_token: AAL376ZHV6H5WYSS7NLLWFTGMBSKY
# ec2_instance_public_ip: false
# ec2_additional_tags: '{\"key3\":\"value3\",\"key4\":\"value4\"}'
# repo_url: https://github.com/Your/Repo
repo_access_token: ${{ secrets.GIT_HUB_TOKEN }}

Check failure on line 58 in .github/workflows/almalinux-compose-test-arm64.yml

View workflow run for this annotation

GitHub Actions / almalinux-compose-test-arm64

Invalid workflow file

The workflow is not valid. .github/workflows/almalinux-compose-test-arm64.yml (Line: 58, Col: 11): 'repo_access_token' is already defined
# stack_destroy: false
# tf_state_bucket_destroy: true
# start-runner:
# timeout-minutes: 5 # normally it only takes 1-2 minutes
# name: Setup and start self-hosted EC2 runner
# runs-on: ubuntu-latest
# permissions:
# actions: write
# steps:
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Start EC2 runner
# id: start-ec2-runner
# uses: NextChapterSoftware/ec2-action-builder@v1
# with:
# github_token: ${{ secrets.GIT_HUB_TOKEN }}
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws_region: ${{ secrets.AWS_REGION }}
# ec2_instance_type: t4g.small
# ec2_ami_id: ${{ inputs.version_major == '9' && 'ami-0ce12a8fbc3cc15a5' || 'ami-01e3e647c7acbc64b' }}
# ec2_subnet_id: subnet-64063c29
# ec2_security_group_id: sg-07e22182e33675edc
# ec2_instance_ttl: 40 # Optional (default is 60 minutes)
# ec2_spot_instance_strategy: None # Other options are: SpotOnly, BestEffort, MaxPerformance
# start-runner:
# name: Start self-hosted EC2 runner
# runs-on: ubuntu-latest
# outputs:
# label: ${{ steps.start-ec2-runner.outputs.label }}
# ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
# steps:
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Start EC2 runner
# id: start-ec2-runner
# uses: machulav/ec2-github-runner@v2
# with:
# mode: start
# github-token: ${{ secrets.GIT_HUB_TOKEN }}
# ec2-image-id: ${{ inputs.version_major == '9' && 'ami-0f76592d493cc4dbb' || 'ami-0b68c0cf818f25ecf' }}
# ec2-instance-type: t4g.small
# subnet-id: subnet-64063c29
# security-group-id: sg-07e22182e33675edc
compose-test:
name: Testing AlmaLinux ${{ inputs.version_major }}
# runs-on: almalinux${{ inputs.version_major }}-arm64-aws-ec2-us-east-1
# runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
runs-on: ${{ github.run_id }}
needs: start-runner # required to start the main job when the runner is ready
steps:
- uses: actions/checkout@v4
- name: Prepare stuff
run: |
# Name of repository to enable (PowerTools/CRB)
dnf_crb_repo='PowerTools'
if [ "${{ inputs.version_major }}" = "9" ]; then
dnf_crb_repo='CRB'
fi
if [ "x${{ inputs.pulp_repository }}" = "xtrue" ]; then
# Lowercase the name for path in pulp's URL
dnf_crb_repo="${dnf_crb_repo,,}"
fi
echo "dnf_crb_repo=${dnf_crb_repo}" >> $GITHUB_ENV
# Clean up tmt run results and repos
sudo rm -rf /var/tmp/tmt/run-* \
/etc/yum.repos.d/almalinux-pungi.repo \
/etc/yum.repos.d/almalinux-pulp.repo
# # Verify that CPU supports hardware virtualization
# echo -n "Number of vmx|svm CPUs: " && grep -E -c '(vmx|svm)' /proc/cpuinfo
# # Use proper Vagrantfile and set ENV variable of config.vm.box
# cp -av ci/Vagrant/Vagrantfile ./
# echo vm_box='almalinux/${{ inputs.version_major }}' > .env
# - name: Install KVM Packages and Start libvirt
# run: |
# sudo apt-get -y update
# sudo apt-get -y install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
# sudo systemctl enable --now libvirtd
# sudo adduser "$(id -un)" libvirt
# sudo adduser "$(id -un)" kvm
# - name: Enable KVM group perms
# run: |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm
# - name: Tune libvirt
# run: virsh list --all
# - name: Install Vagrant
# run: |
# sudo apt-get -y install vagrant
# sudo vagrant --version
# sudo vagrant plugin install vagrant-reload
# sudo vagrant plugin install vagrant-env
# - name: Install the Vagrant libvirt Plugin
# run: |
# sudo cp /etc/apt/sources.list /etc/apt/sources.list."$(date +"%F")"
# sudo sed -i -e '/^# deb-src.*universe$/s/# //g' /etc/apt/sources.list
# sudo apt-get -y update
# sudo apt-get -y install nfs-kernel-server
# sudo systemctl enable --now nfs-server
# sudo apt-get -y build-dep vagrant ruby-libvirt
# sudo apt-get -y install ebtables dnsmasq-base
# sudo apt-get -y install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
# sudo vagrant plugin install vagrant-libvirt
# sudo vagrant plugin install vagrant-scp
- name: Create AlmaLinux pungi repository
if: inputs.pungi_repository
run: |
cat <<'EOF'>/etc/yum.repos.d/almalinux-pungi.repo
[almalinux-${{ inputs.version_major }}-appstream-pungi]
baseurl = http://$arch-pungi-${{ inputs.version_major }}.almalinux.org/almalinux/${{ inputs.version_major }}/$arch/latest_result/compose/AppStream/$arch/os/
enabled = 1
name = almalinux-${{ inputs.version_major }}-appstream-pungi
[almalinux-${{ inputs.version_major }}-baseos-pungi]
baseurl = http://$arch-pungi-${{ inputs.version_major }}.almalinux.org/almalinux/${{ inputs.version_major }}/$arch/latest_result/compose/BaseOS/$arch/os/
enabled = 1
name = almalinux-${{ inputs.version_major }}-baseos-pungi
[almalinux-${{ inputs.version_major }}-${{ env.dnf_crb_repo }}-pungi]
baseurl = http://$arch-pungi-${{ inputs.version_major }}.almalinux.org/almalinux/${{ inputs.version_major }}/$arch/latest_result/compose/${{ env.dnf_crb_repo }}/$arch/os/
enabled = 1
name = almalinux-${{ inputs.version_major }}-${{ env.dnf_crb_repo }}-pungi
EOF
- name: Create AlmaLinux pulp repository
if: inputs.pulp_repository
run: |
cat <<'EOF'>/etc/yum.repos.d/almalinux-pulp.repo
[almalinux-${{ inputs.version_major }}-appstream-pulp]
baseurl = https://build.almalinux.org/pulp/content/prod/almalinux-${{ inputs.version_major }}-appstream-$arch/
enabled = 1
name = almalinux-${{ inputs.version_major }}-appstream-pulp
[almalinux-${{ inputs.version_major }}-baseos-pulp]
baseurl = https://build.almalinux.org/pulp/content/prod/almalinux-${{ inputs.version_major }}-baseos-$arch/
enabled = 1
name = almalinux-${{ inputs.version_major }}-baseos-pulp
[almalinux-${{ inputs.version_major }}-${{ env.dnf_crb_repo }}-pulp]
baseurl = https://build.almalinux.org/pulp/content/prod/almalinux-${{ inputs.version_major }}-${{ env.dnf_crb_repo }}-$arch/
enabled = 1
name = almalinux-${{ inputs.version_major }}-${{ env.dnf_crb_repo }}-pulp
EOF
# - name: Run vagrant up
# run: sudo vagrant up almalinux
- name: Update the system
run: |
sudo dnf -y clean all
sudo dnf -y update
- name: Prepare test infrastructure (dnf install epel-release)
run: sudo dnf -y install epel-release
- name: Prepare test infrastructure (dnf install tmt)
run: |
enable_repo=${{ env.dnf_crb_repo }}
sudo dnf install -y --enablerepo=${enable_repo,,} tmt
# - name: Get compose-tests
# run: sudo vagrant ssh almalinux -c 'sudo cp -a /vagrant /compose-tests'
- name: Run tests
run: sudo sh -c 'export pungi_repository=${{ inputs.pungi_repository }}; export pulp_repository=${{ inputs.pulp_repository }}; tmt -vvv -c distro=centos-stream-${{ inputs.version_major }} run --all provision --how=local test --name "/tests/legacy/p_cpio"'
- name: Print tests results
if: success() || failure()
run: |
sudo cat /var/tmp/tmt/run-001/plans/legacy/execute/results.yaml /var/tmp/tmt/run-001/plans/ng/execute/results.yaml
sudo /bin/cp -av /var/tmp/tmt/run-001/plans/legacy/execute/results.yaml ${{github.action_path}}/legacy.results.yaml
sudo /bin/cp -av /var/tmp/tmt/run-001/plans/ng/execute/results.yaml ${{github.action_path}}/ng.results.yaml
- name: Print tests log
if: success() || failure()
run: |
sudo cat /var/tmp/tmt/run-001/log.txt
sudo /bin/cp -av /var/tmp/tmt/run-001/log.txt ${{github.action_path}}/log.txt
- name: Collect tests output
if: success() || failure()
run: |
cd /var/tmp/tmt/run-001/
tar cf ${{github.action_path}}/output.tar $( find . -name output.txt ) || true
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Tests log
path: ${{github.action_path}}/log.txt
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Tests results
path: ${{github.action_path}}/*.results.yaml
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Tests output
path: ${{github.action_path}}/output.tar
- name: Clean up tmt run results and repos
if: success() || failure()
run: |
sudo rm -rf /var/tmp/tmt/run-* \
${{github.action_path}}/output.tar \
${{github.action_path}}/*.results.yaml \
${{github.action_path}}/log.txt \
/etc/yum.repos.d/almalinux-pungi.repo \
/etc/yum.repos.d/almalinux-pulp.repo
# stop-runner:
# name: Stop self-hosted EC2 runner
# needs:
# - start-runner # required to get output from the start-runner job
# - compose-test # required to wait when the main job is done
# runs-on: ubuntu-latest
# if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
# steps:
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Stop EC2 runner
# uses: machulav/ec2-github-runner@v2
# with:
# mode: stop
# github-token: ${{ secrets.GIT_HUB_TOKEN }}
# label: ${{ needs.start-runner.outputs.label }}
# ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}