Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lv37 committed Jan 22, 2025
1 parent fc19c9c commit c143085
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,34 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
ZED_EXTENSION_CLI_SHA: 5ef75919f09e31c28b75c09e695946b6c4d9c3ee
ZED_EXTENSION_CLI_SHA: b5ce8e7aa500d530389fef4cdd26f4790d013682

jobs:
package:
runs-on: ubuntu-latest
if: github.repository_owner == 'zed-industries'
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
clean: false
fetch-depth: 0

- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "20"
cache: "pnpm"

- name: Cache zed-extension CLI
id: cache-zed-extension
uses: actions/cache@v3
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: |
zed-extension
Expand All @@ -41,14 +47,34 @@ jobs:
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: |
mkdir ./scratch || echo -n
./zed-extension --source-dir . --output-dir ./build --scratch-dir ./scratch
run: pnpm build

- name: Run tests
run: pnpm test

- name: Cache extension build dependencies
uses: actions/cache@v3
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
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` and `.gitmodules`
run: |
if ! git diff --exit-code -- extensions.toml .gitmodules; then
echo -e "\nERROR: extensions.toml and .gitmodules are not sorted."
echo -e "Fix by running:\n pnpm sort-extensions\n"
exit 1
fi

0 comments on commit c143085

Please sign in to comment.