Skip to content

Commit 2a51a0d

Browse files
committed
add windows init tests
1 parent b5ed0a7 commit 2a51a0d

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.github/workflows/it-test.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
os: [ubuntu-latest, macos-latest] # [windows-latest] removed for now
35+
os: [ubuntu-latest, macos-latest, windows-latest]
3636
fail-fast: false
3737
steps:
3838
- name: Checkout code
@@ -68,25 +68,26 @@ jobs:
6868
if: matrix.os != 'windows-latest'
6969
run: chmod +x cli-v2
7070

71-
- name: Run init command tests
72-
if: matrix.os != 'windows-latest'
71+
- name: Install yq
72+
if: matrix.os == 'windows-latest'
73+
run: |
74+
winget install mikefarah.yq
75+
76+
- name: Run init tests
7377
id: run_init_tests
7478
continue-on-error: true
75-
shell: bash
79+
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
7680
env:
7781
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
7882
run: |
79-
# Make the script executable
80-
chmod +x integration-tests/run.sh
81-
82-
# Run the init command tests
83-
echo "Running init command integration tests..."
84-
./integration-tests/run.sh || {
85-
echo "❌ Init command tests failed"
86-
echo "::error::Init command tests failed. Please check the logs above for details."
87-
exit 1
88-
}
89-
echo "✅ Init command tests passed successfully!"
83+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
84+
# Run PowerShell script on Windows
85+
./integration-tests/run.ps1
86+
else
87+
# Run Bash script on Unix/Linux
88+
chmod +x integration-tests/run.sh
89+
./integration-tests/run.sh
90+
fi
9091
9192
- name: Run tool tests
9293
if: matrix.os != 'windows-latest'
@@ -124,7 +125,7 @@ jobs:
124125
fi
125126
126127
- name: Check test results
127-
if: steps.run_tests.outcome == 'failure' || steps.run_init_tests.outcome == 'failure'
128+
if: failure()
128129
run: |
129130
echo "Job failed because some tests failed. Please check the logs above for details."
130131
exit 1

0 commit comments

Comments
 (0)