Repository navigation
191 lines (170 loc) · 5.46 KB
/
Copy pathtest.yml
File metadata and controls
191 lines (170 loc) · 5.46 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Test Python packages
run: |
for dir in */; do
if [ -f "$dir/pyproject.toml" ]; then
echo "=== testing $dir ==="
uv run --project "$dir" python -m unittest discover -s "$dir/tests" -v
uv build --project "$dir"
uvx --from "./$dir" "${dir%/}" --help
fi
done
python3 bin/experimental-exe-ssh.py --help
- name: Test all Go modules
run: |
for dir in */; do
if [ "$dir" != "execonnect/" ] && [ -f "$dir/go.mod" ]; then
echo "=== testing $dir ==="
(cd "$dir" && go test ./...)
fi
done
- name: Check execonnect
run: make -C execonnect check
- name: Test exe-tty
env:
GH_TOKEN: ${{ github.token }}
run: |
curl -fsSL https://mise.run | sh
export PATH="$HOME/.local/bin:$PATH"
make -C exe-tty test
auto-tag:
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: write
needs: test
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Auto-tag changed modules
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
for dir in */; do
[ -f "$dir/go.mod" ] || continue
module="${dir%/}"
latest_tag=$(git tag -l "$module/v*" --sort=-v:refname | head -1)
if [ -n "$latest_tag" ] && [ -z "$(git diff "$latest_tag" -- "$module/")" ]; then
echo "=== $module: no changes since $latest_tag, skipping ==="
continue
fi
COUNT=$(git rev-list --count HEAD -- "$module/")
SHORT_SHA=$(git rev-parse --short=6 HEAD)
SHA_OCTAL=$(printf '%o' "0x${SHORT_SHA}")
TAG="${module}/v0.${COUNT}.9${SHA_OCTAL}"
if git tag -l "$TAG" | grep -q .; then
echo "=== $module: $TAG already exists, skipping ==="
continue
fi
echo "=== tagging $module as $TAG ==="
git tag -a "$TAG" -m "Auto-tag $module at ${SHORT_SHA}"
git push origin "$TAG"
done
build-exe-scroll-darwin:
runs-on: macos-14
if: github.event_name == 'push'
needs: test
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build exe-scroll for macOS
run: |
mkdir -p exe-scroll/dist-darwin
for arch in amd64 arm64; do
OUT_DIR="$PWD/exe-scroll/dist-$arch" bin/build-exe-scroll-darwin.sh "$arch"
cp "exe-scroll/dist-$arch/bin/exe-scroll" "exe-scroll/dist-darwin/exe-scroll-darwin-$arch"
done
file exe-scroll/dist-darwin/*
- uses: actions/upload-artifact@v4
with:
name: exe-scroll-darwin
path: exe-scroll/dist-darwin/*
release-exe-scroll:
runs-on: ubuntu-latest
if: github.event_name == 'push'
concurrency:
group: release-exe-scroll
cancel-in-progress: false
permissions:
contents: write
needs: [test, build-exe-scroll-darwin]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: exe-scroll-darwin
path: exe-scroll/dist-darwin
- name: Build and release exe-scroll
env:
GH_TOKEN: ${{ github.token }}
run: |
exe-scroll/release.sh
tag=$(git tag -l 'exe-scroll/v*' --sort=-v:refname | head -1)
existing=$(gh release view "$tag" --json assets --jq '.assets[].name')
for asset in exe-scroll/dist-darwin/*; do
name=$(basename "$asset")
if printf '%s\n' "$existing" | grep -Fqx "$name"; then
echo "$tag already has $name"
else
gh release upload "$tag" "$asset"
fi
done
release-exe-tty:
runs-on: ubuntu-latest
if: github.event_name == 'push'
concurrency:
group: release-exe-tty
cancel-in-progress: false
permissions:
contents: write
# After release-exe-scroll, so that a new exe-scroll gets embedded.
needs: [test, auto-tag, release-exe-scroll]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build and release exe-tty
env:
GH_TOKEN: ${{ github.token }}
run: |
curl -fsSL https://mise.run | sh
export PATH="$HOME/.local/bin:$PATH"
exe-tty/release.sh
release-execonnect:
runs-on: ubuntu-latest
if: github.event_name == 'push'
concurrency:
group: release-execonnect
cancel-in-progress: false
permissions:
contents: write
needs: [test, auto-tag]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: execonnect/go.mod
- name: Build and release execonnect
env:
GH_TOKEN: ${{ github.token }}
run: execonnect/release.sh