Skip to content

Commit bdf7e96

Browse files
committed
feat: enable macOS
1 parent 80b2eb5 commit bdf7e96

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/run-all-unit-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-latest, ubuntu-24.04-arm]
19+
os: [macos-latest]
2020
# os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
2121

2222
steps:
@@ -30,10 +30,10 @@ jobs:
3030
if: runner.os == 'Linux'
3131
run: loginctl enable-linger $(whoami)
3232

33-
# - name: Setup tmate session
34-
# uses: mxschmitt/action-tmate@v3
35-
3633
- run: npm ci
3734
- run: npx tsx scripts/cleanup-github-actions.ts
3835

36+
- name: Setup tmate session
37+
uses: mxschmitt/action-tmate@v3
38+
3939
- run: npm run test -- ./test --no-file-parallelism --silent=passed-only

scripts/cleanup-github-actions.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { PluginTester, testSpawn } from '@codifycli/plugin-test';
22
import path from 'node:path';
3+
import { Utils } from '@codifycli/plugin-core';
34

45
const pluginPath = path.resolve('./src/index.ts');
56

@@ -9,12 +10,20 @@ await PluginTester.uninstall(pluginPath, [
910
{ type: 'aws-cli'}
1011
]);
1112

12-
await testSpawn('apt-get autoremove -y ruby rpm python awscli', { requiresRoot: true });
13+
if (Utils.isLinux()) {
14+
await testSpawn('apt-get autoremove -y ruby rpm python awscli needrestart', { requiresRoot: true }); // remove needrestart to keep logs clean.
1315

14-
await testSpawn('rustup self uninstall -y');
16+
await testSpawn('rustup self uninstall -y');
1517

16-
await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true })
17-
await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true })
18-
await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true })
18+
await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true })
19+
await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true })
20+
await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true })
1921

2022
// await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true });
23+
24+
// MacOS
25+
} else {
26+
await PluginTester.uninstall(pluginPath, [
27+
{ type: 'brew', formulae: ['chrome', 'python', 'ruby', 'awscli'] },
28+
]);
29+
}

0 commit comments

Comments
 (0)