Skip to repository content229 lines · 9.1 KB · yaml
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T01:48:44.752Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
extension_tests.yml
1# Generated from xtask::workflows::extension_tests
2# Rebuild with `cargo xtask workflows`.
3name: extension_tests
4env:
5 CARGO_TERM_COLOR: always
6 RUST_BACKTRACE: '1'
7 CARGO_INCREMENTAL: '0'
8 ZED_EXTENSION_CLI_SHA: 9ee3c503a4bbbc6b4a0f8a789acca4871d773223
9 RUSTUP_TOOLCHAIN: stable
10 CARGO_BUILD_TARGET: wasm32-wasip2
11on:
12 workflow_call:
13 inputs:
14 working-directory:
15 description: working-directory
16 type: string
17 default: .
18permissions:
19 contents: read
20jobs:
21 orchestrate:
22 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
23 runs-on: namespace-profile-2x4-ubuntu-2404
24 steps:
25 - name: steps::checkout_repo
26 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
27 with:
28 clean: false
29 fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
30 - id: filter
31 name: filter
32 run: |
33 set -euo pipefail
34 if [ -z "$GITHUB_BASE_REF" ]; then
35 echo "Not in a PR context (i.e., push to main/stable/preview)"
36 COMPARE_REV="$(git rev-parse HEAD~1)"
37 else
38 echo "In a PR context comparing to pull_request.base.ref"
39 git fetch origin "$GITHUB_BASE_REF" --depth=350
40 COMPARE_REV="$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)"
41 fi
42 CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" "$GITHUB_SHA")"
43
44 # When running from a subdirectory, git diff returns repo-root-relative paths.
45 # Filter to only files within the current working directory and strip the prefix.
46 REPO_SUBDIR="$(git rev-parse --show-prefix)"
47 REPO_SUBDIR="${REPO_SUBDIR%/}"
48 if [ -n "$REPO_SUBDIR" ]; then
49 CHANGED_FILES="$(echo "$CHANGED_FILES" | grep "^${REPO_SUBDIR}/" | sed "s|^${REPO_SUBDIR}/||" || true)"
50 fi
51
52 check_pattern() {
53 local output_name="$1"
54 local pattern="$2"
55 local grep_arg="$3"
56
57 echo "$CHANGED_FILES" | grep "$grep_arg" "$pattern" && \
58 echo "${output_name}=true" >> "$GITHUB_OUTPUT" || \
59 echo "${output_name}=false" >> "$GITHUB_OUTPUT"
60 }
61
62 check_pattern "check_rust" '^(Cargo.lock|Cargo.toml|.*\.rs)$' -qP
63 check_pattern "check_extension" '^(extension\.toml|.*\.scm)$' -qP
64 outputs:
65 check_rust: ${{ steps.filter.outputs.check_rust }}
66 check_extension: ${{ steps.filter.outputs.check_extension }}
67 defaults:
68 run:
69 shell: bash -euxo pipefail {0}
70 working-directory: ${{ inputs.working-directory }}
71 check_rust:
72 needs:
73 - orchestrate
74 if: needs.orchestrate.outputs.check_rust == 'true'
75 runs-on: namespace-profile-8x32-ubuntu-2404
76 steps:
77 - name: steps::checkout_repo
78 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
79 with:
80 clean: false
81 - name: steps::cache_rust_dependencies_namespace
82 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
83 with:
84 cache: rust
85 path: ~/.rustup
86 - name: extension_tests::install_rust_target
87 run: rustup target add wasm32-wasip2
88 - id: get-package-name
89 name: extension_tests::get_package_name
90 run: |
91 PACKAGE_NAME="$(sed -n 's/^name = "\(.*\)"/\1/p' < Cargo.toml | head -1 | tr -d '[:space:]')"
92 echo "package_name=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"
93 - name: extension_tests::cargo_fmt_package
94 run: cargo fmt -p "$PACKAGE_NAME" -- --check
95 env:
96 PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
97 - name: extension_tests::run_clippy
98 run: cargo clippy -p "$PACKAGE_NAME" --release --all-features -- --deny warnings
99 env:
100 PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
101 - name: steps::cargo_install_nextest
102 uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9
103 with:
104 tool: nextest
105 - name: extension_tests::run_nextest
106 run: 'cargo nextest run -p "$PACKAGE_NAME" --no-fail-fast --no-tests=warn --target "$(rustc -vV | sed -n ''s|host: ||p'')"'
107 env:
108 PACKAGE_NAME: ${{ steps.get-package-name.outputs.package_name }}
109 NEXTEST_NO_TESTS: warn
110 timeout-minutes: 6
111 defaults:
112 run:
113 shell: bash -euxo pipefail {0}
114 working-directory: ${{ inputs.working-directory }}
115 check_extension:
116 needs:
117 - orchestrate
118 if: needs.orchestrate.outputs.check_extension == 'true'
119 runs-on: namespace-profile-8x32-ubuntu-2404
120 steps:
121 - name: steps::checkout_repo
122 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
123 with:
124 clean: false
125 fetch-depth: 0
126 - id: cache-zed-extension-cli
127 name: extension_tests::cache_zed_extension_cli
128 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
129 with:
130 path: zed-extension
131 key: zed-extension-${{ env.ZED_EXTENSION_CLI_SHA }}
132 - name: extension_tests::download_zed_extension_cli
133 if: steps.cache-zed-extension-cli.outputs.cache-hit != 'true'
134 run: |
135 wget --quiet "https://zed-extension-cli.nyc3.digitaloceanspaces.com/$ZED_EXTENSION_CLI_SHA/x86_64-unknown-linux-gnu/zed-extension" -O "$GITHUB_WORKSPACE/zed-extension"
136 chmod +x "$GITHUB_WORKSPACE/zed-extension"
137 - name: steps::cache_rust_dependencies_namespace
138 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
139 with:
140 cache: rust
141 path: ~/.rustup
142 - name: extension_tests::check
143 run: |
144 mkdir -p /tmp/ext-scratch
145 mkdir -p /tmp/ext-output
146 "$GITHUB_WORKSPACE/zed-extension" --source-dir . --scratch-dir /tmp/ext-scratch --output-dir /tmp/ext-output
147 - name: run_tests::fetch_ts_query_ls
148 uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
149 with:
150 repo: ribru17/ts_query_ls
151 version: tags/v3.15.1
152 file: ts_query_ls-x86_64-unknown-linux-gnu.tar.gz
153 - name: run_tests::run_ts_query_ls
154 run: |-
155 tar -xf "$GITHUB_WORKSPACE/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz" -C "$GITHUB_WORKSPACE"
156 "$GITHUB_WORKSPACE/ts_query_ls" format --check languages || {
157 echo "Found unformatted queries, please format them with ts_query_ls."
158 echo "For easy use, install the Tree-sitter query extension:"
159 echo "zed://extension/tree-sitter-query"
160 false
161 }
162 - id: compare-versions-check
163 name: extension_bump::compare_versions
164 run: |
165 CURRENT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
166
167 if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
168 PR_FORK_POINT="$(git merge-base origin/main HEAD)"
169 git checkout "$PR_FORK_POINT"
170 else
171 git checkout "$(git log -1 --format=%H)"~1
172 fi
173
174 PARENT_COMMIT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
175
176 [[ "$CURRENT_VERSION" == "$PARENT_COMMIT_VERSION" ]] && \
177 echo "version_changed=false" >> "$GITHUB_OUTPUT" || \
178 echo "version_changed=true" >> "$GITHUB_OUTPUT"
179
180 echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
181 - name: extension_tests::verify_version_did_not_change
182 run: |
183 if [[ "$VERSION_CHANGED" == "true" && "$GITHUB_EVENT_NAME" == "pull_request" && "$PR_USER_LOGIN" != "zed-zippy[bot]" ]] ; then
184 echo "Version change detected in your change!"
185 echo "Version changes happen in separate PRs and will be performed by the zed-zippy bot"
186 exit 42
187 fi
188 env:
189 VERSION_CHANGED: ${{ steps.compare-versions-check.outputs.version_changed }}
190 PR_USER_LOGIN: ${{ github.event.pull_request.user.login }}
191 timeout-minutes: 6
192 defaults:
193 run:
194 shell: bash -euxo pipefail {0}
195 working-directory: ${{ inputs.working-directory }}
196 tests_pass:
197 needs:
198 - orchestrate
199 - check_rust
200 - check_extension
201 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
202 runs-on: namespace-profile-2x4-ubuntu-2404
203 steps:
204 - name: run_tests::tests_pass
205 run: |
206 set +x
207 EXIT_CODE=0
208
209 check_result() {
210 echo "* $1: $2"
211 if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
212 }
213
214 check_result "orchestrate" "$RESULT_ORCHESTRATE"
215 check_result "check_rust" "$RESULT_CHECK_RUST"
216 check_result "check_extension" "$RESULT_CHECK_EXTENSION"
217
218 exit $EXIT_CODE
219 env:
220 RESULT_ORCHESTRATE: ${{ needs.orchestrate.result }}
221 RESULT_CHECK_RUST: ${{ needs.check_rust.result }}
222 RESULT_CHECK_EXTENSION: ${{ needs.check_extension.result }}
223concurrency:
224 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}extension-tests
225 cancel-in-progress: true
226defaults:
227 run:
228 shell: bash -euxo pipefail {0}
229