-
Notifications
You must be signed in to change notification settings - Fork 437
77 lines (62 loc) · 1.89 KB
/
ci.yml
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
name: CI
on:
pull_request:
push:
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ZED_EXTENSION_CLI_SHA: 5ef75919f09e31c28b75c09e695946b6c4d9c3ee
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
clean: false
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: "pnpm"
- name: Cache zed-extension CLI
id: cache-zed-extension
uses: actions/cache@v3
with:
path: |
zed-extension
key: zed-extension-${{ env.ZED_EXTENSION_CLI_SHA }}
- name: Download zed-extension CLI if not cached
if: steps.cache-zed-extension.outputs.cache-hit != 'true'
run: |
wget --quiet "https://zed-extension-cli.nyc3.digitaloceanspaces.com/$ZED_EXTENSION_CLI_SHA/x86_64-unknown-linux-gnu/zed-extension"
chmod +x zed-extension
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Run tests
run: pnpm test
- name: Cache extension build dependencies
uses: actions/cache@v3
with:
key: cache-build-dependencies
path: |
./scratch
- name: Package extensions
run: pnpm package-extensions
env:
SHOULD_PUBLISH: ${{ github.ref_name == 'main' }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
- name: Enforce sorted `extensions.toml`
run: git diff --exit-code -- extensions.toml
- name: Enforce sorted `.gitmodules`
run: git diff --exit-code -- .gitmodules