-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (80 loc) · 2.92 KB
/
test.yml
File metadata and controls
103 lines (80 loc) · 2.92 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
name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
# ── Build & command tests on all 3 platforms ────────────────────────────────
test:
name: Build & Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Build
run: go build -ldflags="-X main.version=test" -o gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} .
- name: Version
run: ./gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} version
- name: Help
run: ./gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} help
- name: Auth status (no key set)
run: ./gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} auth status
- name: Auth status (env var)
run: ./gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} auth status
env:
GROQ_API_KEY: gsk_testkey1234567890
- name: Config show
run: ./gitpilot${{ matrix.os == 'windows-latest' && '.exe' || '' }} config show
env:
GROQ_API_KEY: gsk_testkey1234567890
# ── install.sh test on Linux and macOS ─────────────────────────────────────
test-installer-unix:
name: install.sh on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run install.sh
run: sh install.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify installed binary
run: gitpilot version
- name: Verify auth status works
run: gitpilot auth status
# ── install.ps1 test on Windows ─────────────────────────────────────────────
test-installer-windows:
name: install.ps1 on Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run install.ps1
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
.\install.ps1
- name: Verify installed binary
shell: pwsh
run: |
$bin = "$env:LOCALAPPDATA\Programs\gitpilot\gitpilot.exe"
& $bin version
- name: Verify auth status works
shell: pwsh
run: |
$bin = "$env:LOCALAPPDATA\Programs\gitpilot\gitpilot.exe"
& $bin auth status