Avoid package to generate UUID (#8) #17
This file contains 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
name: Integration | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/integrate.yml' | |
- 'action.yml' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/integrate.yml' | |
- 'action.yml' | |
env: | |
TEST_CONTENT: "This is a content string for test" | |
jobs: | |
test_defaults: | |
name: Test defaults | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Call action w/o inputs | |
id: call | |
uses: ./ | |
continue-on-error: true | |
- name: Verify FS | |
id: verify | |
run: | | |
cat <<EOF > "${{ steps.call.outputs.mnt }}/content" | |
${{ env.TEST_CONTENT }} | |
EOF | |
test "$(cat "${{ steps.call.outputs.mnt }}/content")" = "${{ env.TEST_CONTENT }}" | |
continue-on-error: true | |
- name: Cleanup | |
id: cleanup | |
run: | | |
sudo umount "${{ steps.call.outputs.mnt }}" | |
continue-on-error: true | |
- name: Proper exit | |
run: | | |
if [ ${{ steps.call.outcome }} != 'success' \ | |
-o ${{ steps.verify.outcome }} != 'success' \ | |
-o ${{ steps.cleanup.outcome }} != 'success' ] | |
then | |
echo ":x: Test failed" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
else | |
echo ":heavy_check_mark: Test succeeded" >> $GITHUB_STEP_SUMMARY | |
fi | |
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: ${{ env.SIZE }} | |
- name: Verify FS | |
id: verify | |
run: | | |
cat <<EOF > "${{ steps.call.outputs.mnt }}/content" | |
${{ 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 | |
id: cleanup | |
run: | | |
sudo umount "${{ steps.call.outputs.mnt }}" | |
continue-on-error: true | |
- name: Proper exit | |
run: | | |
if [ ${{ steps.call.outcome }} != 'success' \ | |
-o ${{ steps.verify.outcome }} != 'success' \ | |
-o ${{ steps.cleanup.outcome }} != 'success' ] | |
then | |
echo ":x: Test failed" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
else | |
echo ":heavy_check_mark: Test succeeded" >> $GITHUB_STEP_SUMMARY | |
fi | |
test_root: | |
name: Test root | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Call action with root | |
id: call | |
uses: ./ | |
with: | |
root: ./test_root | |
- name: Verify FS | |
id: verify | |
run: | | |
cat <<EOF > "${{ steps.call.outputs.mnt }}/content" | |
${{ env.TEST_CONTENT }} | |
EOF | |
test "$(cat "${{ steps.call.outputs.mnt }}/content")" = "${{ env.TEST_CONTENT }}" | |
continue-on-error: true | |
- name: Cleanup | |
id: cleanup | |
run: | | |
sudo umount "${{ steps.call.outputs.mnt }}" | |
continue-on-error: true | |
- name: Proper exit | |
run: | | |
if [ ${{ steps.call.outcome }} != 'success' \ | |
-o ${{ steps.verify.outcome }} != 'success' \ | |
-o ${{ steps.cleanup.outcome }} != 'success' ] | |
then | |
echo ":x: Test failed" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
else | |
echo ":heavy_check_mark: Test succeeded" >> $GITHUB_STEP_SUMMARY | |
fi |