-
-
Notifications
You must be signed in to change notification settings - Fork 17
70 lines (57 loc) · 1.62 KB
/
Copy pathinstall-script.yml
File metadata and controls
70 lines (57 loc) · 1.62 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
---
name: Install Script Test
on:
pull_request:
branches: [main]
paths:
- 'install.sh'
- 'install.ps1'
- '.github/workflows/install-script.yml'
release:
types: [published]
workflow_dispatch:
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run ShellCheck on install script
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: '.'
format: gcc
severity: warning
test-install:
name: Test Install (${{ matrix.os }})
needs: [shellcheck]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test install script functionality (PR/manual)
if: github.event_name != 'release'
shell: bash
run: |
chmod +x install.sh
./install.sh --help
bash -c 'source ./install.sh && detect_platform'
bash -n install.sh
- name: Test actual installation (release)
if: github.event_name == 'release'
env:
BINARY_DEFAULT: ${{ vars.BINARY_DEFAULT }}
shell: bash
run: |
chmod +x install.sh
./install.sh --tag "${{ github.event.release.tag_name }}"
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
"$HOME/.local/bin/${BINARY_DEFAULT}.exe" --version
else
"$HOME/.local/bin/${BINARY_DEFAULT}" --version
fi