Skip to content

Commit

Permalink
Merge pull request #1184 from posit-dev/dotnomad/iso-lint-vscode
Browse files Browse the repository at this point in the history
Isolate VSCode extension lint and formatting checks
  • Loading branch information
sagerb authored Mar 21, 2024
2 parents 4e87522 + 1e6d9a0 commit 90eccff
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
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'
- 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

0 comments on commit 90eccff

Please sign in to comment.