-
Notifications
You must be signed in to change notification settings - Fork 6
104 lines (90 loc) · 3.25 KB
/
install-script-tests.yml
File metadata and controls
104 lines (90 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Install Script Tests
on:
push:
paths:
- 'install-cli.sh'
- '.github/workflows/install-script-tests.yml'
- 'bin/test_install_script.sh'
- 'bin/test_install_script_over_homebrew.sh'
- 'npm/**'
- '.goreleaser.yml'
- 'scripts/npm-publish.sh'
pull_request:
paths:
- 'install-cli.sh'
- '.github/workflows/install-script-tests.yml'
- 'bin/test_install_script.sh'
- 'bin/test_install_script_over_homebrew.sh'
- 'npm/**'
- '.goreleaser.yml'
- 'scripts/npm-publish.sh'
workflow_dispatch:
release:
types: [published]
jobs:
test-script:
name: Test Bash Script on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Harden Runner
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@v6
- name: Run install script test
shell: bash
run: |
chmod +x install-cli.sh
bash bin/test_install_script.sh --token ${{ secrets.GITHUB_TOKEN }}
mac-homebrew:
name: Test Homebrew Installation on macOS
runs-on: macos-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@v6
- name: Run Homebrew install
shell: bash
run: brew install kosli-cli
- name: Verify Homebrew installation
shell: bash
run: command -v kosli
- name: Run install script test
shell: bash
run: |
chmod +x install-cli.sh
bash bin/test_install_script_over_homebrew.sh --token ${{ secrets.GITHUB_TOKEN }}
# Note: this job installs from the public npm registry, so on push/PR
# it tests the currently published version — not the code being changed.
# That still catches regressions. The release trigger is what tests new releases.
test-npm:
name: Test npm install on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest # linux/x64
- ubuntu-24.04-arm # linux/arm64
- macos-latest # darwin/arm64
- windows-latest # win32/x64
- windows-11-arm # win32/arm64
steps:
- name: Install @kosli/cli via npm
shell: bash
run: |
TAG="${{ github.event.release.tag_name }}"
if [[ "${{ github.event_name }}" == "release" && "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
npm install -g @kosli/cli@latest
else
npm install -g @kosli/cli@snapshot
fi
- name: Verify kosli binary works
shell: bash
run: kosli version