Skip to content

Commit e9392ee

Browse files
committed
ci: Fix: remove dos lines
DOS lines need to be removed for checkpatch checker Signed-off-by: Vishal Kumar <[email protected]>
1 parent 8e30800 commit e9392ee

File tree

5 files changed

+451
-451
lines changed

5 files changed

+451
-451
lines changed
Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
name: AWS S3 Helper
2-
description: Upload and download files from AWS S3
3-
4-
inputs:
5-
s3_bucket:
6-
description: S3 Bucket Name
7-
required: true
8-
local_file:
9-
description: Local file paths
10-
required: false
11-
default: ../artifacts/file_list.txt
12-
download_file:
13-
description: Download file paths
14-
required: false
15-
default: ''
16-
mode:
17-
description: Mode of operation (upload/download)
18-
required: true
19-
default: single-upload
20-
21-
outputs:
22-
presigned_url:
23-
description: Pre-signed URL for the uploaded file
24-
value: ${{ steps.sync-data.outputs.presigned_url }}
25-
26-
runs:
27-
using: "composite"
28-
steps:
29-
- name: Sync Data
30-
id: sync-data
31-
shell: bash
32-
env:
33-
UPLOAD_LOCATION: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.workflow }}/${{ github.head_ref != '' && github.head_ref || github.run_id }}/
34-
run: |
35-
echo "::group::$(printf '__________ %-100s' 'Process' | tr ' ' _)"
36-
case "${{ inputs.mode }}" in
37-
multi-upload)
38-
echo "Uploading files to S3 bucket..."
39-
first_line=true
40-
# Start the JSON object
41-
echo "{" > ${{ github.workspace }}/presigned_urls.json
42-
while IFS= read -r file; do
43-
if [ -f "$file" ]; then
44-
echo "Uploading $file..."
45-
aws s3 cp "$file" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
46-
echo "Uploaded $file to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
47-
echo "Creating Pre-signed URL for $file..."
48-
filename=$(basename "$file")
49-
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}$filename --expires-in 3600)
50-
if [ "$first_line" = true ]; then
51-
first_line=false
52-
else
53-
echo "," >> ${{ github.workspace }}/presigned_urls.json
54-
fi
55-
# Append the pre-signed URL to the file
56-
echo " \"${file}\": \"${presigned_url}\"" >> ${{ github.workspace }}/presigned_urls.json
57-
echo "Pre-signed URL for $file: $presigned_url"
58-
else
59-
echo "Warning: $file does not exist or is not a regular file."
60-
fi
61-
done < "${{ inputs.local_file }}"
62-
# Close the JSON object
63-
echo "}" >> ${{ github.workspace }}/presigned_urls.json
64-
;;
65-
single-upload)
66-
echo "Uploading single file to S3 bucket..."
67-
aws s3 cp "${{ inputs.local_file }}" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
68-
echo "Uploaded ${{ inputs.local_file }} to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
69-
echo "Creating Pre-signed URL for ${{ inputs.local_file }}..."
70-
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}${{ inputs.local_file }} --expires-in 3600)
71-
echo "presigned_url=${presigned_url}" >> "$GITHUB_OUTPUT"
72-
;;
73-
download)
74-
#Download The required file from s3
75-
echo "Downloading files from S3 bucket..."
76-
aws s3 sync s3://${{ inputs.s3_bucket }}/${{ inputs.download_file }} .
77-
;;
78-
*)
79-
echo "Invalid mode. Use 'upload' or 'download'."
80-
exit 1
81-
;;
82-
esac
83-
84-
- name: Upload artifacts
85-
if: ${{ inputs.mode == 'multi-upload' }}
86-
uses: actions/upload-artifact@v4
87-
with:
88-
name: presigned_urls.json
89-
path: ${{ github.workspace }}/presigned_urls.json
1+
name: AWS S3 Helper
2+
description: Upload and download files from AWS S3
3+
4+
inputs:
5+
s3_bucket:
6+
description: S3 Bucket Name
7+
required: true
8+
local_file:
9+
description: Local file paths
10+
required: false
11+
default: ../artifacts/file_list.txt
12+
download_file:
13+
description: Download file paths
14+
required: false
15+
default: ''
16+
mode:
17+
description: Mode of operation (upload/download)
18+
required: true
19+
default: single-upload
20+
21+
outputs:
22+
presigned_url:
23+
description: Pre-signed URL for the uploaded file
24+
value: ${{ steps.sync-data.outputs.presigned_url }}
25+
26+
runs:
27+
using: "composite"
28+
steps:
29+
- name: Sync Data
30+
id: sync-data
31+
shell: bash
32+
env:
33+
UPLOAD_LOCATION: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.workflow }}/${{ github.head_ref != '' && github.head_ref || github.run_id }}/
34+
run: |
35+
echo "::group::$(printf '__________ %-100s' 'Process' | tr ' ' _)"
36+
case "${{ inputs.mode }}" in
37+
multi-upload)
38+
echo "Uploading files to S3 bucket..."
39+
first_line=true
40+
# Start the JSON object
41+
echo "{" > ${{ github.workspace }}/presigned_urls.json
42+
while IFS= read -r file; do
43+
if [ -f "$file" ]; then
44+
echo "Uploading $file..."
45+
aws s3 cp "$file" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
46+
echo "Uploaded $file to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
47+
echo "Creating Pre-signed URL for $file..."
48+
filename=$(basename "$file")
49+
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}$filename --expires-in 3600)
50+
if [ "$first_line" = true ]; then
51+
first_line=false
52+
else
53+
echo "," >> ${{ github.workspace }}/presigned_urls.json
54+
fi
55+
# Append the pre-signed URL to the file
56+
echo " \"${file}\": \"${presigned_url}\"" >> ${{ github.workspace }}/presigned_urls.json
57+
echo "Pre-signed URL for $file: $presigned_url"
58+
else
59+
echo "Warning: $file does not exist or is not a regular file."
60+
fi
61+
done < "${{ inputs.local_file }}"
62+
# Close the JSON object
63+
echo "}" >> ${{ github.workspace }}/presigned_urls.json
64+
;;
65+
single-upload)
66+
echo "Uploading single file to S3 bucket..."
67+
aws s3 cp "${{ inputs.local_file }}" s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}
68+
echo "Uploaded ${{ inputs.local_file }} to s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}"
69+
echo "Creating Pre-signed URL for ${{ inputs.local_file }}..."
70+
presigned_url=$(aws s3 presign s3://${{ inputs.s3_bucket }}/${{ env.UPLOAD_LOCATION }}${{ inputs.local_file }} --expires-in 3600)
71+
echo "presigned_url=${presigned_url}" >> "$GITHUB_OUTPUT"
72+
;;
73+
download)
74+
#Download The required file from s3
75+
echo "Downloading files from S3 bucket..."
76+
aws s3 sync s3://${{ inputs.s3_bucket }}/${{ inputs.download_file }} .
77+
;;
78+
*)
79+
echo "Invalid mode. Use 'upload' or 'download'."
80+
exit 1
81+
;;
82+
esac
83+
84+
- name: Upload artifacts
85+
if: ${{ inputs.mode == 'multi-upload' }}
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: presigned_urls.json
89+
path: ${{ github.workspace }}/presigned_urls.json
9090
retention-days: 1

.github/actions/build/action.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
name: Build workspace
2-
description: Build workspace
3-
4-
inputs:
5-
docker_image:
6-
description: Docker image
7-
required: true
8-
default: kmake-image:latest
9-
10-
runs:
11-
using: "composite"
12-
steps:
13-
- name: Download artifacts
14-
shell: bash
15-
run: |
16-
mkdir -p ../artifacts && \
17-
wget -O ../artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz && \
18-
wget -O ../artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb && \
19-
dpkg-deb -xv ../artifacts/systemd-boot-efi.deb ../artifacts/systemd
20-
21-
- name: Make
22-
shell: bash
23-
run: |
24-
docker run -i --rm \
25-
--user $(id -u):$(id -g) \
26-
--workdir="$PWD" \
27-
-v "$(dirname $PWD)":"$(dirname $PWD)" \
28-
${{ inputs.docker_image }} bash -c "
29-
make O=../kobj defconfig
30-
make O=../kobj -j$(nproc)
31-
make O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1
32-
"
33-
34-
- name: Package DLKM into ramdisk
35-
shell: bash
36-
run: |
1+
name: Build workspace
2+
description: Build workspace
3+
4+
inputs:
5+
docker_image:
6+
description: Docker image
7+
required: true
8+
default: kmake-image:latest
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Download artifacts
14+
shell: bash
15+
run: |
16+
mkdir -p ../artifacts && \
17+
wget -O ../artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz && \
18+
wget -O ../artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb && \
19+
dpkg-deb -xv ../artifacts/systemd-boot-efi.deb ../artifacts/systemd
20+
21+
- name: Make
22+
shell: bash
23+
run: |
24+
docker run -i --rm \
25+
--user $(id -u):$(id -g) \
26+
--workdir="$PWD" \
27+
-v "$(dirname $PWD)":"$(dirname $PWD)" \
28+
${{ inputs.docker_image }} bash -c "
29+
make O=../kobj defconfig
30+
make O=../kobj -j$(nproc)
31+
make O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1
32+
"
33+
34+
- name: Package DLKM into ramdisk
35+
shell: bash
36+
run: |
3737
(cd ../kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)

0 commit comments

Comments
 (0)