Skip to content

Commit 2b49c81

Browse files
committed
Fix syntax error.
1 parent 79d722b commit 2b49c81

File tree

2 files changed

+47
-45
lines changed

2 files changed

+47
-45
lines changed

Diff for: .github/workflows/test.yml

+42-42
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v3
2222

23-
- name: Set up environment
23+
- name: Set up environment (Linux)
2424
if: ${{ matrix.os == 'ubuntu-latest' }}
2525
shell: bash
2626
run: |
2727
echo "Running on Linux"
28-
- name: Set up environment
28+
- name: Set up environment (MacOS)
2929
if: ${{ matrix.os == 'macos-latest' }}
3030
shell: bash
3131
run: |
3232
echo "Running on macOS"
33-
- name: Set up environment
33+
- name: Set up environment (Windows)
3434
if: ${{ matrix.os == 'windows-latest' }}
3535
shell: pwsh
3636
run: |
@@ -45,45 +45,45 @@ jobs:
4545
env:
4646
CI: true
4747

48-
# - name: Simulate Failure Scenarios
49-
# if: ${{ matrix.action == 'install' }}
50-
# shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
51-
# run: |
52-
# # Fail download step intentionally
53-
# echo "Testing download failure scenario"
54-
# exit 1 # Simulate download failure
48+
- name: Simulate Failure Scenarios
49+
if: ${{ matrix.action == 'install' }}
50+
shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
51+
run: |
52+
# Fail download step intentionally
53+
echo "Testing download failure scenario"
54+
exit 1 # Simulate download failure
5555
56-
# - name: Simulate Report Command Failure
57-
# if: ${{ matrix.action == 'report' }}
58-
# shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
59-
# run: |
60-
# echo "Testing report command failure"
61-
# ~/bin/coveralls report # Simulated failure
56+
- name: Simulate Report Command Failure
57+
if: ${{ matrix.action == 'report' }}
58+
shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
59+
run: |
60+
echo "Testing report command failure"
61+
~/bin/coveralls report # Simulated failure
6262
63-
# - name: Simulate Done Command Failure
64-
# if: ${{ matrix.action == 'done' }}
65-
# shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
66-
# run: |
67-
# echo "Testing done command failure"
68-
# ~/bin/coveralls done # Simulated failure
63+
- name: Simulate Done Command Failure
64+
if: ${{ matrix.action == 'done' }}
65+
shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
66+
run: |
67+
echo "Testing done command failure"
68+
~/bin/coveralls done # Simulated failure
6969
70-
# - name: Verify Outcome
71-
# shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
72-
# run: |
73-
# if [[ "${{ matrix.fail_on_error }}" == "true" ]]; then
74-
# # Expect failure exit code
75-
# if [[ $? -eq 0 ]]; then
76-
# echo "Test failed: expected failure but action succeeded."
77-
# exit 1
78-
# else
79-
# echo "Test succeeded: expected failure and action failed as expected."
80-
# fi
81-
# else
82-
# # Expect success exit code
83-
# if [[ $? -ne 0 ]]; then
84-
# echo "Test failed: expected success but action failed."
85-
# exit 1
86-
# else
87-
# echo "Test succeeded: expected success and action succeeded."
88-
# fi
89-
# fi
70+
- name: Verify Outcome
71+
shell: ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
72+
run: |
73+
if [[ "${{ matrix.fail_on_error }}" == "true" ]]; then
74+
# Expect failure exit code
75+
if [[ $? -eq 0 ]]; then
76+
echo "Test failed: expected failure but action succeeded."
77+
exit 1
78+
else
79+
echo "Test succeeded: expected failure and action failed as expected."
80+
fi
81+
else
82+
# Expect success exit code
83+
if [[ $? -ne 0 ]]; then
84+
echo "Test failed: expected success but action failed."
85+
exit 1
86+
else
87+
echo "Test succeeded: expected success and action succeeded."
88+
fi
89+
fi

Diff for: action.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ runs:
117117
fi
118118
119119
# List files to ensure they are downloaded
120+
echo "Show current directory:"
121+
pwd
120122
echo "Downloaded files:"
121123
ls -la
122124
@@ -131,7 +133,7 @@ runs:
131133
tar -xzf coveralls-linux.tar.gz
132134
133135
# List files again to verify extraction
134-
echo "List current directory:"
136+
echo "Show current directory:"
135137
pwd
136138
echo "Files after extraction:"
137139
ls -la
@@ -167,7 +169,7 @@ runs:
167169
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
168170
exit 1
169171
fi
170-
~/bin/coveralls done \
172+
coveralls done \
171173
${{ inputs.debug == 'true' && '--debug' || '' }} \
172174
${{ inputs.measure == 'true' && '--measure' || '' }} \
173175
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
@@ -190,7 +192,7 @@ runs:
190192
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
191193
exit 1
192194
fi
193-
~/bin/coveralls report \
195+
coveralls report \
194196
${{ inputs.debug == 'true' && '--debug' || '' }} \
195197
${{ inputs.measure == 'true' && '--measure' || '' }} \
196198
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }} \

0 commit comments

Comments
 (0)