Skip to content

Commit 8ad7954

Browse files
committed
gh matrixes
1 parent 7c0ad27 commit 8ad7954

File tree

2 files changed

+241
-178
lines changed

2 files changed

+241
-178
lines changed

.github/workflows/ci.yml

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
name: Tests
13+
name: Tests (${{ matrix.os }})
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, macos-latest, windows-latest]
@@ -33,8 +33,101 @@ jobs:
3333
- name: Install deps
3434
run: pnpm install
3535

36-
- name: Run tests
37-
run: pnpm test
36+
- name: Run core tests (excluding shell integration)
37+
run: pnpm test --exclude="**/shell-integration.test.ts"
38+
39+
shell-tests:
40+
name: Shell Tests (${{ matrix.shell }} on ${{ matrix.os }})
41+
strategy:
42+
matrix:
43+
shell: [bash, zsh, fish, powershell]
44+
os: [ubuntu-latest, macos-latest]
45+
exclude:
46+
# PowerShell installation can be flaky on macOS in CI
47+
- shell: powershell
48+
os: macos-latest
49+
runs-on: ${{ matrix.os }}
50+
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Install shell dependencies (Ubuntu)
56+
if: matrix.os == 'ubuntu-latest'
57+
run: |
58+
sudo apt-get update
59+
case "${{ matrix.shell }}" in
60+
bash)
61+
sudo apt-get install -y bash-completion
62+
;;
63+
zsh)
64+
sudo apt-get install -y zsh
65+
;;
66+
fish)
67+
sudo apt-get install -y fish
68+
;;
69+
powershell)
70+
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
71+
sudo dpkg -i packages-microsoft-prod.deb
72+
sudo apt-get update
73+
sudo apt-get install -y powershell
74+
;;
75+
esac
76+
77+
- name: Install shell dependencies (macOS)
78+
if: matrix.os == 'macos-latest'
79+
run: |
80+
case "${{ matrix.shell }}" in
81+
bash)
82+
brew install bash-completion@2
83+
;;
84+
zsh)
85+
# zsh is already installed on macOS
86+
echo "zsh already available"
87+
;;
88+
fish)
89+
brew install fish
90+
;;
91+
powershell)
92+
# Skip PowerShell on macOS for now due to CI flakiness
93+
echo "PowerShell skipped on macOS"
94+
;;
95+
esac
96+
97+
- name: Verify shell installation
98+
run: |
99+
case "${{ matrix.shell }}" in
100+
bash)
101+
bash --version
102+
;;
103+
zsh)
104+
zsh --version
105+
;;
106+
fish)
107+
fish --version
108+
;;
109+
powershell)
110+
pwsh --version
111+
;;
112+
esac
113+
114+
- name: Install pnpm
115+
uses: pnpm/[email protected]
116+
117+
- name: Set node version to 20
118+
uses: actions/setup-node@v4
119+
with:
120+
node-version: 20
121+
registry-url: https://registry.npmjs.org/
122+
cache: 'pnpm'
123+
124+
- name: Install deps
125+
run: pnpm install
126+
127+
- name: Run shell-specific tests
128+
run: pnpm test tests/shell-integration.test.ts
129+
env:
130+
TEST_SHELL: ${{ matrix.shell }}
38131

39132
typecheck:
40133
name: Lint and Type Check

0 commit comments

Comments
 (0)