Skip to content

Commit

Permalink
Adds CI for Positron extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Oct 24, 2023
1 parent e623807 commit 13ba895
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Extensions
name: JupyterLab
on:
workflow_call:
jobs:
jupyterlab:
native:
env:
DOCKER: false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runner: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
jobs:
agent:
uses: ./.github/workflows/agent.yaml
extensions:
uses: ./.github/workflows/extensions.yaml
web:
uses: ./.github/workflows/web.yaml
build:
uses: ./.github/workflows/build.yaml
jupyterlab:
uses: ./.github/workflows/jupyterlab.yaml
web:
uses: ./.github/workflows/web.yaml
bats:
needs: build
uses: ./.github/workflows/bats.yaml
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/positron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Positron
on:
workflow_call:
jobs:
native:
env:
DOCKER: false
strategy:
fail-fast: false
matrix:
runner: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: just positron
docker:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- run: just positron
6 changes: 4 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ concurrency:
jobs:
agent:
uses: ./.github/workflows/agent.yaml
extensions:
uses: ./.github/workflows/extensions.yaml
jupyterlab:
uses: ./.github/workflows/jupyterlab.yaml
positron:
uses: ./.github/workflows/positron.yaml
web:
uses: ./.github/workflows/web.yaml
build:
Expand Down
3 changes: 1 addition & 2 deletions extensions/positron/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
out
dist
node_modules
.vscode-test-web/
.vscode-test/
*.vsix
5
60 changes: 60 additions & 0 deletions extensions/positron/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
alias c := clean
alias i := install
alias t := test

_ci := env_var_or_default("CI", "false")

_debug := env_var_or_default("DEBUG", "false")

_with_debug := if _debug == "true" {
"set -x pipefail"
} else {
""
}

default:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
just install
just test

# Deletes ephemeral project files (i.e., cleans the project).
clean:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
rm -rf node_modules


# Install dependencies
install:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
npm install

# Executes commands via `npm`. Equivalent to `npm run`. Provides arbitrary command chaining inside of Docker from project root (i.e., `just positron run test`)
run *args:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
npm run {{ args }}


# Executes Cypress tests
test:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
echo {{ os() }}
if [ {{ os() }} == "linux" ]; then
xvfb-run -a npm test
else
npm test
fi
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ pre-release:
./scripts/is-pre-release.bash

positron *args:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
just _with_docker just extensions/positron/{{ args }}

# Runs the CLI via `go run`.
run *args:
#!/usr/bin/env bash
Expand Down

0 comments on commit 13ba895

Please sign in to comment.