@@ -21,17 +21,17 @@ jobs:
21
21
uses : actions/checkout@v3
22
22
23
23
- name : Set up environment
24
- if : matrix.os == 'ubuntu-latest'
24
+ if : ${{ matrix.os == 'ubuntu-latest' }}
25
25
shell : bash
26
26
run : |
27
27
echo "Running on Linux"
28
28
- name : Set up environment
29
- if : matrix.os == 'macos-latest'
29
+ if : ${{ matrix.os == 'macos-latest' }}
30
30
shell : bash
31
31
run : |
32
32
echo "Running on macOS"
33
33
- name : Set up environment
34
- if : matrix.os == 'windows-latest'
34
+ if : ${{ matrix.os == 'windows-latest' }}
35
35
shell : pwsh
36
36
run : |
37
37
echo "Running on Windows"
@@ -47,27 +47,28 @@ jobs:
47
47
48
48
- name : Simulate Failure Scenarios
49
49
if : ${{ matrix.action == 'install' }}
50
+ shell : ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
50
51
run : |
51
52
# Fail download step intentionally
52
53
echo "Testing download failure scenario"
53
54
exit 1 # Simulate download failure
54
- shell : ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
55
55
56
56
- name : Simulate Report Command Failure
57
57
if : ${{ matrix.action == 'report' }}
58
+ shell : ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
58
59
run : |
59
60
echo "Testing report command failure"
60
61
~/bin/coveralls report # Simulated failure
61
- shell : ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
62
62
63
63
- name : Simulate Done Command Failure
64
64
if : ${{ matrix.action == 'done' }}
65
+ shell : ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
65
66
run : |
66
67
echo "Testing done command failure"
67
68
~/bin/coveralls done # Simulated failure
68
- shell : ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
69
69
70
70
- name : Verify Outcome
71
+ shell : ${{ startsWith(matrix.os, 'windows-latest') && 'pwsh' || 'bash' }}
71
72
run : |
72
73
if [[ "${{ matrix.fail_on_error }}" == "true" ]]; then
73
74
# Expect failure exit code
85
86
else
86
87
echo "Test succeeded: expected success and action succeeded."
87
88
fi
88
- shell : ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
89
-
89
+ fi
0 commit comments