From a01fbcd8c8943982280e5700cb563a7882b45324 Mon Sep 17 00:00:00 2001 From: Anders Hafreager Date: Mon, 10 Jun 2024 12:17:07 +0200 Subject: [PATCH] Added workflow for Streamlit --- .github/workflows/verify-jupyter.yml | 2 +- .github/workflows/verify-streamlit.yml | 28 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify-streamlit.yml diff --git a/.github/workflows/verify-jupyter.yml b/.github/workflows/verify-jupyter.yml index d102d48239..14690cd0a1 100644 --- a/.github/workflows/verify-jupyter.yml +++ b/.github/workflows/verify-jupyter.yml @@ -18,7 +18,7 @@ jobs: with: node-version: "20" - name: Install dependencies - run: npm install pyodide@0.25.0 + run: npm install pyodide@0.25.0 # JupyterLite currently using pyodide 0.25.1 - name: Install cognite-sdk in pyodide environment run: | whl_file=$(find dist -name "*.whl" | sed 's|^dist/||') # Find the built wheel file, remove dist/ prefix diff --git a/.github/workflows/verify-streamlit.yml b/.github/workflows/verify-streamlit.yml new file mode 100644 index 0000000000..27e1f7ba39 --- /dev/null +++ b/.github/workflows/verify-streamlit.yml @@ -0,0 +1,28 @@ +--- +name: build + +on: + pull_request: + branches: [master] + +jobs: + build_and_test_jupyter_pyodide: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - name: Build package + run: poetry build + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + - name: Install dependencies + run: npm install pyodide@0.25.1 # stlite currently using pyodide 0.25.1 + - name: Install cognite-sdk in pyodide environment + run: | + whl_file=$(find dist -name "*.whl" | sed 's|^dist/||') # Find the built wheel file, remove dist/ prefix + echo "Found built wheel file: $whl_file" + SDK_FILE_PATH=$whl_file \ + PACKAGES="[\"pyodide-http\", \"http://localhost:3000/dist/$whl_file\"]" \ + node scripts/test-pyodide.js