Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate VSCode extension lint and formatting checks #1184

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint
on: [workflow_call]
env:
DOCKER: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
Comment on lines +12 to +15
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to use Node 20 right away here to help with #908.

I also setup NPM dependency caching so this workflow is extremely lightweight.

- run: just vscode deps
- run: just vscode lint
- run: just vscode check-format
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
# Linting and formatting
lint:
uses: ./.github/workflows/lint.yaml

# Unit Tests
agent:
uses: ./.github/workflows/agent.yaml
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/vscode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
path: ./extensions/vscode/.vscode-test/vscode-*
key: ${{ matrix.runner }}-vscode-${{ env.VSCODE_VERSION }}-${{ steps.get-date.outputs.date }}
- run: just vscode configure
- run: just vscode lint
- run: just vscode check-format
- run: just vscode test
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -53,8 +51,6 @@ jobs:
path: ./extensions/vscode/.vscode-test/vscode-*
key: docker-vscode-${{ env.VSCODE_VERSION }}-${{ steps.get-date.outputs.date }}
- run: just vscode configure
- run: just vscode lint
- run: just vscode check-format
- run: just vscode test
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
12 changes: 11 additions & 1 deletion extensions/vscode/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,26 @@ clean:
rm -rf node_modules
rm -rf out

configure os="$(just ../../os)" arch="$(just ../../arch)":
# Install dependencies
deps:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

if [ {{ _ci }} = "true" ]; then
npm ci --no-audit --no-fund | sed 's/^/debug: /'
else
npm install --no-audit --no-fund | sed 's/^/debug: /'
fi


configure os="$(just ../../os)" arch="$(just ../../arch)":
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

just deps

echo "info: checking for compatible binary executable..." 1>&2
binary_executable=$(just ../../executable-path {{ os }} {{ arch }})
if ! [ -f "$binary_executable" ]; then
Expand Down
Loading