Skip to content

Commit

Permalink
Suffix size in MB (#6)
Browse files Browse the repository at this point in the history
* Suffix size in MB
* Test expected size too

---------

Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
  • Loading branch information
btlogy authored Apr 7, 2023
1 parent 5430860 commit e41bc11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ jobs:
test_size:
name: Test size
runs-on: ubuntu-latest
env:
SIZE: 4
steps:
- uses: actions/checkout@v3

- name: Call action with size
id: call
uses: ./
with:
size: 4
size: ${{ env.SIZE }}

- name: Verify FS
id: verify
Expand All @@ -73,6 +75,7 @@ jobs:
${{ env.TEST_CONTENT }}
EOF
test "$(cat "${{ steps.call.outputs.mnt }}/content")" = "${{ env.TEST_CONTENT }}"
mount | grep ${{ steps.call.outputs.mnt }} | grep "size=$((${{ env.SIZE }} * 1024))"
continue-on-error: true

- name: Cleanup
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
sudo mkdir -p "${MNT}" \
&& echo ":heavy_check_mark: Temp FS mount point creation succeeded" >> $GITHUB_STEP_SUMMARY \
|| { echo ":x: Temp FS mount point creation failed" >> $GITHUB_STEP_SUMMARY; exit 1; }
sudo mount -o size=${{ inputs.size }},uid=$(id -u) -t tmpfs tmpfs "${MNT}" \
sudo mount -o size=${{ inputs.size }}M,uid=$(id -u) -t tmpfs tmpfs "${MNT}" \
&& echo ":heavy_check_mark: Temp FS mount operation succeeded" >> $GITHUB_STEP_SUMMARY \
|| { echo ":x: Temp FS mount operation failed" >> $GITHUB_STEP_SUMMARY; exit 1; }
echo "uuid=${UUID}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit e41bc11

Please sign in to comment.