Skip to content

Commit

Permalink
Merge branch 'main' into kg-extract-dist
Browse files Browse the repository at this point in the history
  • Loading branch information
kgartland-rstudio authored Oct 1, 2024
2 parents d61178f + 783cb8a commit 3cd025c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 43 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/bats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
# deploy only these content
CONTENT: "fastapi-simple quarto-website-py"
CONNECT_LICENSE: ${{ secrets.CONNECT_LICENSE }}
PYTHON_VERSION: 3.12.1
PYTHON_VERSION: 3.12
QUARTO_VERSION: 1.4.549
strategy:
fail-fast: false
Expand Down Expand Up @@ -37,6 +37,7 @@ jobs:
with:
version: ${{ env.QUARTO_VERSION }}
- uses: extractions/setup-just@v2

- uses: actions/download-artifact@v4
with:
name: bin
Expand All @@ -45,5 +46,6 @@ jobs:
- run: chmod -R +x ./bin
- run: just bats install
- run: just bats test common
- run: just bats build-connect
- run: just bats test init
- run: just bats test deploy
14 changes: 0 additions & 14 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ jobs:
needs: nightly
secrets: inherit
uses: ./.github/workflows/cleanup.yaml
package:
needs: build
uses: ./.github/workflows/package.yaml
archive:
needs: build
uses: ./.github/workflows/archive.yaml
upload:
needs:
- archive
- package
uses: ./.github/workflows/upload.yaml
with:
nightly: true
secrets: inherit

# Extensions
vscode:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ jobs:
secrets: inherit
uses: ./.github/workflows/bats.yaml

# disable the vscode-ui tests for now
# vscode-ui:
# needs: build
# secrets: inherit
# uses: ./.github/workflows/vscode-ui.yaml
vscode-ui:
needs:
- build
- package
secrets: inherit
uses: ./.github/workflows/vscode-ui.yaml
44 changes: 24 additions & 20 deletions .github/workflows/vscode-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
env:
VSCODE_VERSION: stable
jobs:
native:
ui-tests:
env:
DOCKER: false
DOCKER_CONNECT: true
# deploy only these content
CONTENT: "fastapi-simple quarto-website-py"
CONNECT_LICENSE: ${{ secrets.CONNECT_LICENSE }}
CI: true
QUARTO_VERSION: 1.4.549
PYTHON_VERSION: 3.12.4
strategy:
fail-fast: false
matrix:
Expand All @@ -22,32 +22,36 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/setup
- uses: extractions/setup-just@v2
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/checkout@v4
with:
repository: rstudio/connect-content
path: "test/content"
sparse-checkout: bundles
sparse-checkout-cone-mode: false
token: ${{ secrets.CONNECT_PAT }}

- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.4.549
python-version: ${{ env.PYTHON_VERSION }}
# disabling quarto until we need it
# - uses: quarto-dev/quarto-actions/setup@v2
# with:
# version: ${{ env.QUARTO_VERSION }}
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- uses: actions/download-artifact@v4
with:
name: dist
path: dist

- uses: t1m0thyj/unlock-keyring@v1
- run: chmod -R +x ./bin
- run: just package

- name: Extract dist
run: unzip dist/*-linux-amd64.vsix -d dist/ext

- run: just vscode configure
- run: just vscode-ui install
- run: just vscode-ui test
- run: just vscode-ui build-connect
- run: just vscode-ui test vscode-nested
env:
SPEC_PATH: ./test/specs/nested-fastapi.spec.ts
WORKSPACE_PATH: ../sample-content/

- name: Save screenshots
uses: actions/upload-artifact@v4
Expand Down
8 changes: 8 additions & 0 deletions test/bats/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ default:
just install
just test

build-connect:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
docker compose -f ../docker-compose.yml build

# Deletes ephemeral project files (i.e., cleans the project).
clean:
#!/usr/bin/env bash
Expand Down Expand Up @@ -53,6 +60,7 @@ fuzzbucket-stop:
pip install -r ../setup/requirements.txt
fuzzbucket-client rm connect-publishing-client

# Executes commands via `npm`. Equivalent to `npm run`. Provides arbitrary command chaining inside of Docker from project root (i.e., `just bats run test`)
run *args:
#!/usr/bin/env bash
Expand Down
3 changes: 1 addition & 2 deletions test/scripts/test-runner.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ fi
setup_connect() {
pip install -r ../setup/requirements.txt
if [[ "${DOCKER_CONNECT}" = true ]]; then
docker compose -f ../docker-compose.yml build
docker compose -f ../docker-compose.yml up -d
export CONNECT_SERVER="http://localhost:3939"
export CONNECT_API_KEY="$(python ../setup/gen_apikey.py 'admin')"
# wait until Connect is available
timeout 100 bash -c \
timeout 10 bash -c \
'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${CONNECT_SERVER}/__ping__)" != "200" ]]; \
do sleep 1; \
echo "retry"; \
Expand Down
3 changes: 2 additions & 1 deletion test/vscode-ui/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build-connect:
set -eou pipefail
{{ _with_debug }}
docker compose build
docker compose -f ../docker-compose.yml build

# Deletes ephemeral project files (i.e., cleans the project).
clean:
Expand Down Expand Up @@ -67,4 +67,5 @@ test *args:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
../scripts/test-runner.bash {{ args }}

0 comments on commit 3cd025c

Please sign in to comment.