Skip to content

ci: fix: remove dos lines #14

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 89 additions & 89 deletions .github/actions/aws_s3_helper/action.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
name: AWS S3 Helper
description: Upload and download files from AWS S3
inputs:
s3_bucket:
description: S3 Bucket Name
required: true
local_file:
description: Local file paths
required: false
default: ../artifacts/file_list.txt
download_file:
description: Download file paths
required: false
default: ''
mode:
description: Mode of operation (upload/download)
required: true
default: single-upload
outputs:
presigned_url:
description: Pre-signed URL for the uploaded file
value: ${{ steps.sync-data.outputs.presigned_url }}
runs:
using: "composite"
steps:
- name: Sync Data
id: sync-data
shell: bash
env:
UPLOAD_LOCATION: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.workflow }}/${{ github.head_ref != '' && github.head_ref || github.run_id }}/
run: |
echo "::group::$(printf '__________ %-100s' 'Process' | tr ' ' _)"
case "${{ inputs.mode }}" in
multi-upload)
echo "Uploading files to S3 bucket..."
first_line=true
# Start the JSON object
echo "{" > ${{ github.workspace }}/presigned_urls.json
while IFS= read -r file; do
if [ -f "$file" ]; then
echo "Uploading $file..."
aws s3 cp "$file" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
echo "Uploaded $file to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
echo "Creating Pre-signed URL for $file..."
filename=$(basename "$file")
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}$filename --expires-in 3600)
if [ "$first_line" = true ]; then
first_line=false
else
echo "," >> ${{ github.workspace }}/presigned_urls.json
fi
# Append the pre-signed URL to the file
echo " \"${file}\": \"${presigned_url}\"" >> ${{ github.workspace }}/presigned_urls.json
echo "Pre-signed URL for $file: $presigned_url"
else
echo "Warning: $file does not exist or is not a regular file."
fi
done < "${{ inputs.local_file }}"
# Close the JSON object
echo "}" >> ${{ github.workspace }}/presigned_urls.json
;;
single-upload)
echo "Uploading single file to S3 bucket..."
aws s3 cp "${{ inputs.local_file }}" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
echo "Uploaded ${{ inputs.local_file }} to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
echo "Creating Pre-signed URL for ${{ inputs.local_file }}..."
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}${{ inputs.local_file }} --expires-in 3600)
echo "presigned_url=${presigned_url}" >> "$GITHUB_OUTPUT"
;;
download)
#Download The required file from s3
echo "Downloading files from S3 bucket..."
aws s3 sync s3://${{ inputs.s3_bucket }}/${{ inputs.download_file }} .
;;
*)
echo "Invalid mode. Use 'upload' or 'download'."
exit 1
;;
esac
- name: Upload artifacts
if: ${{ inputs.mode == 'multi-upload' }}
uses: actions/upload-artifact@v4
with:
name: presigned_urls.json
path: ${{ github.workspace }}/presigned_urls.json
name: AWS S3 Helper
description: Upload and download files from AWS S3

inputs:
s3_bucket:
description: S3 Bucket Name
required: true
local_file:
description: Local file paths
required: false
default: ../artifacts/file_list.txt
download_file:
description: Download file paths
required: false
default: ''
mode:
description: Mode of operation (upload/download)
required: true
default: single-upload

outputs:
presigned_url:
description: Pre-signed URL for the uploaded file
value: ${{ steps.sync-data.outputs.presigned_url }}

runs:
using: "composite"
steps:
- name: Sync Data
id: sync-data
shell: bash
env:
UPLOAD_LOCATION: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.workflow }}/${{ github.head_ref != '' && github.head_ref || github.run_id }}/
run: |
echo "::group::$(printf '__________ %-100s' 'Process' | tr ' ' _)"
case "${{ inputs.mode }}" in
multi-upload)
echo "Uploading files to S3 bucket..."
first_line=true
# Start the JSON object
echo "{" > ${{ github.workspace }}/presigned_urls.json
while IFS= read -r file; do
if [ -f "$file" ]; then
echo "Uploading $file..."
aws s3 cp "$file" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
echo "Uploaded $file to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
echo "Creating Pre-signed URL for $file..."
filename=$(basename "$file")
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}$filename --expires-in 3600)
if [ "$first_line" = true ]; then
first_line=false
else
echo "," >> ${{ github.workspace }}/presigned_urls.json
fi
# Append the pre-signed URL to the file
echo " \"${file}\": \"${presigned_url}\"" >> ${{ github.workspace }}/presigned_urls.json
echo "Pre-signed URL for $file: $presigned_url"
else
echo "Warning: $file does not exist or is not a regular file."
fi
done < "${{ inputs.local_file }}"
# Close the JSON object
echo "}" >> ${{ github.workspace }}/presigned_urls.json
;;
single-upload)
echo "Uploading single file to S3 bucket..."
aws s3 cp "${{ inputs.local_file }}" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
echo "Uploaded ${{ inputs.local_file }} to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
echo "Creating Pre-signed URL for ${{ inputs.local_file }}..."
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}${{ inputs.local_file }} --expires-in 3600)
echo "presigned_url=${presigned_url}" >> "$GITHUB_OUTPUT"
;;
download)
#Download The required file from s3
echo "Downloading files from S3 bucket..."
aws s3 sync s3://${{ inputs.s3_bucket }}/${{ inputs.download_file }} .
;;
*)
echo "Invalid mode. Use 'upload' or 'download'."
exit 1
;;
esac

- name: Upload artifacts
if: ${{ inputs.mode == 'multi-upload' }}
uses: actions/upload-artifact@v4
with:
name: presigned_urls.json
path: ${{ github.workspace }}/presigned_urls.json
retention-days: 1
72 changes: 36 additions & 36 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Build workspace
description: Build workspace
inputs:
docker_image:
description: Docker image
required: true
default: kmake-image:latest
runs:
using: "composite"
steps:
- name: Download artifacts
shell: bash
run: |
mkdir -p ../artifacts && \
wget -O ../artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz && \
wget -O ../artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb && \
dpkg-deb -xv ../artifacts/systemd-boot-efi.deb ../artifacts/systemd
- name: Make
shell: bash
run: |
docker run -i --rm \
--user $(id -u):$(id -g) \
--workdir="$PWD" \
-v "$(dirname $PWD)":"$(dirname $PWD)" \
${{ inputs.docker_image }} bash -c "
make O=../kobj defconfig
make O=../kobj -j$(nproc)
make O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1
"
- name: Package DLKM into ramdisk
shell: bash
run: |
name: Build workspace
description: Build workspace

inputs:
docker_image:
description: Docker image
required: true
default: kmake-image:latest

runs:
using: "composite"
steps:
- name: Download artifacts
shell: bash
run: |
mkdir -p ../artifacts && \
wget -O ../artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz && \
wget -O ../artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb && \
dpkg-deb -xv ../artifacts/systemd-boot-efi.deb ../artifacts/systemd

- name: Make
shell: bash
run: |
docker run -i --rm \
--user $(id -u):$(id -g) \
--workdir="$PWD" \
-v "$(dirname $PWD)":"$(dirname $PWD)" \
${{ inputs.docker_image }} bash -c "
make O=../kobj defconfig
make O=../kobj -j$(nproc)
make O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1
"

- name: Package DLKM into ramdisk
shell: bash
run: |
(cd ../kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)
Loading
Loading