Repository navigation
165 lines (146 loc) · 5.06 KB
/
Copy pathcli-install.yml
File metadata and controls
165 lines (146 loc) · 5.06 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: cli-install
# Installs this catalog through `npx skills add`, the path users take, and
# checks what lands on disk. See .github/scripts/test_cli_install.py for the
# scenarios.
#
# Runs nightly, about an hour after federate-skills.yml, so it also covers the
# skills that run imports from other repos without a pull request.
#
# local `main` installed from its checkout path; clones nothing.
# remote amd/skills cloned from GitHub in every source form the README
# documents -- what users get.
# latest-cli the same against the newest CLI release, as an early warning.
on:
schedule:
# 07:23 UTC, after the 06:17 federation run has had time to land.
- cron: "23 7 * * *"
workflow_dispatch:
inputs:
cli-version:
description: "`skills` CLI version for the pinned jobs (default 1.7.0)"
required: false
default: ""
permissions:
contents: read
concurrency:
group: cli-install-${{ github.ref }}
cancel-in-progress: true
env:
SKILLS_CLI_VERSION: ${{ inputs.cli-version || '1.7.0' }}
jobs:
local:
name: local / ${{ matrix.os }} / ${{ matrix.mode }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
mode: [symlink, copy]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install from the checkout
shell: bash
run: uv run .github/scripts/test_cli_install.py --source . --mode "${{ matrix.mode }}"
# Every remote job checks the clone against one checkout, so they all need the
# same revision of `main`, resolved once up front.
resolve:
name: Resolve main
if: github.repository == 'amd/skills'
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.main.outputs.sha }}
steps:
- id: main
run: |
sha=$(git ls-remote https://github.com/amd/skills refs/heads/main | cut -f1)
test -n "$sha"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "Testing amd/skills@$sha"
remote:
name: remote / ${{ matrix.os }} / ${{ matrix.source }} / ${{ matrix.mode }}
needs: resolve
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
mode: [symlink, copy]
source: [shorthand, https, pinned-repo, pinned-skill]
include:
- source: shorthand
spec: "amd/skills"
- source: https
spec: "https://github.com/amd/skills"
- source: pinned-repo
spec: "https://github.com/amd/skills/tree/@SHA@"
- source: pinned-skill
spec: "https://github.com/amd/skills/tree/@SHA@/skills/local-ai-use"
extra: "--expect local-ai-use --scenarios install reinstall remove global update"
env:
SHA: ${{ needs.resolve.outputs.sha }}
steps:
- name: Check out amd/skills at the resolved main
uses: actions/checkout@v4
with:
repository: amd/skills
ref: ${{ needs.resolve.outputs.sha }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install from GitHub
shell: bash
env:
SPEC: ${{ matrix.spec }}
run: |
uv run .github/scripts/test_cli_install.py \
--source "${SPEC//@SHA@/$SHA}" --mode "${{ matrix.mode }}" ${{ matrix.extra }}
# The unpinned forms clone whatever `main` is when they run; a merge
# landing mid-run makes them disagree with the checkout.
- name: Flag a moved main
if: failure() && (matrix.source == 'shorthand' || matrix.source == 'https')
shell: bash
run: |
now=$(git ls-remote https://github.com/amd/skills refs/heads/main | cut -f1)
if [ "$now" != "$SHA" ]; then
echo "::warning::main moved from $SHA to $now during the run; re-run before trusting this failure."
fi
latest-cli:
name: latest CLI / ${{ matrix.os }}
needs: resolve
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
SKILLS_CLI_VERSION: latest
steps:
- name: Check out amd/skills at the resolved main
uses: actions/checkout@v4
with:
repository: amd/skills
ref: ${{ needs.resolve.outputs.sha }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install with the latest CLI
shell: bash
run: |
uv run .github/scripts/test_cli_install.py \
--source "https://github.com/amd/skills/tree/${{ needs.resolve.outputs.sha }}"