Skip to content

Commit 98fbba8

Browse files
committed
workflow: Run tests using project devcontainer image
1 parent 7b12ef2 commit 98fbba8

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

.devcontainer/tools.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ PY$(subst .,,$1) := $$(BIN)/python$1
6565

6666
$$(PY$(subst .,,$1)): | $$(UV)
6767
$$(UV) python find $1 || $$(UV) python install $1
68-
ln -s $$$$($$(UV) python find $1) $$@
69-
7068
$$@ --version
7169

7270
endif

.github/workflows/vscode-pr.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ jobs:
7272
test:
7373
name: "Python v${{ matrix.python-version }}"
7474
runs-on: ubuntu-latest
75+
container:
76+
image: ghcr.io/swyddfa/esbonio-devenv
77+
credentials:
78+
username: ${{ github.actor }}
79+
password: ${{ secrets.github_token }}
80+
7581
timeout-minutes: 20
7682
strategy:
7783
fail-fast: false
@@ -81,27 +87,7 @@ jobs:
8187
steps:
8288
- uses: actions/checkout@v4
8389

84-
- uses: 'actions/setup-node@v4'
85-
with:
86-
node-version: 20.x
87-
cache: 'npm'
88-
cache-dependency-path: 'code/package-lock.json'
89-
90-
- name: Setup Python ${{ matrix.python-version }}
91-
uses: actions/setup-python@v5
92-
with:
93-
python-version: ${{ matrix.python-version }}
94-
allow-prereleases: true
95-
9690
- run: |
9791
cd code/
98-
make dev-deps
99-
npx tsc -p .
100-
101-
# Force the extension to use this version of Python
102-
python --version
103-
export ESBONIO_SERVER_PYCMD=$(command -v python)
104-
echo $ESBONIO_SERVER_PYCMD
105-
106-
xvfb-run -a npm run test
92+
make test
10793
name: Run Tests

code/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@ include ../.devcontainer/tools.mk
22

33
ESBONIO ?= --pre esbonio
44

5+
export PATH := $(BIN):$(PATH)
6+
57
.PHONY: clean
68
clean:
79
rm -r bundled node_modules dist
810

11+
# Run the test suite, either locally or in CI
912
.PHONY: test
10-
test: dev-deps $(NPM)
13+
test: dev-deps | $(NPM)
1114
-test -d dist && rm -r dist
1215
$(NPX) tsc -p .
16+
ifeq ($(CI),true)
17+
ESBONIO_SERVER_PYCMD=$$($(UV) find python $(PYTHON_VERSION)) echo $$ESBONIO_SERVER_PYCMD
18+
ESBONIO_SERVER_PYCMD=$$($(UV) find python $(PYTHON_VERSION)) xvfb-run -a $(NPM) run test
19+
else
1320
$(NPM) run test
21+
endif
22+
1423

1524
.PHONY: watch
1625
watch: dev-deps $(NPM)

0 commit comments

Comments
 (0)