-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(wrappers/python): debug windows .venv path quirk
- Loading branch information
Showing
3 changed files
with
106 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,75 +42,75 @@ jobs: | |
with: | ||
fetch-depth: 1 | ||
|
||
- name: Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
~/.rustup | ||
target | ||
key: ${{ runner.os }}-${{ matrix.rust }}-min165 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
target: ${{ matrix.target }} | ||
override: true | ||
default: true | ||
components: rustfmt, clippy | ||
|
||
- name: Check versions | ||
run: | | ||
cargo --version | ||
rustc --version | ||
- name: Install wasm-pack | ||
uses: jetli/[email protected] | ||
with: | ||
version: ${{env.WASM_PACK_VERSION}} | ||
|
||
- name: Build Coupled JS | ||
working-directory: ./pagefind_web_js | ||
run: npm i && npm run build-coupled | ||
|
||
- name: Build WASM | ||
working-directory: ./pagefind_web | ||
run: ./local_build.sh | ||
|
||
- name: Build UI | ||
working-directory: ./pagefind_ui/default | ||
run: npm i && npm run build | ||
|
||
- name: Build Modular UI | ||
working-directory: ./pagefind_ui/modular | ||
run: npm i && npm run build | ||
|
||
- name: Test Web | ||
working-directory: ./pagefind_web | ||
run: cargo test --release | ||
|
||
- name: Build Testing Binary | ||
working-directory: ./pagefind | ||
run: cargo build --release --features extended | ||
|
||
- name: Upload Testing Binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pagefind-${{ matrix.target }} | ||
path: target/release/pagefind${{ matrix.build == 'windows' && '.exe' || '' }} | ||
|
||
- name: Test Lib | ||
working-directory: ./pagefind | ||
run: cargo test --release --lib --features extended | ||
|
||
- name: Test CLI | ||
run: ./test_ci.sh "release" | ||
# - name: Cache | ||
# uses: actions/cache@v4 | ||
# with: | ||
# path: | | ||
# ~/.cargo/registry | ||
# ~/.cargo/git | ||
# ~/.rustup | ||
# target | ||
# key: ${{ runner.os }}-${{ matrix.rust }}-min165 | ||
|
||
# - uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: 20 | ||
|
||
# - name: Install Rust | ||
# uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: ${{ matrix.rust }} | ||
# target: ${{ matrix.target }} | ||
# override: true | ||
# default: true | ||
# components: rustfmt, clippy | ||
|
||
# - name: Check versions | ||
# run: | | ||
# cargo --version | ||
# rustc --version | ||
|
||
# - name: Install wasm-pack | ||
# uses: jetli/[email protected] | ||
# with: | ||
# version: ${{env.WASM_PACK_VERSION}} | ||
|
||
# - name: Build Coupled JS | ||
# working-directory: ./pagefind_web_js | ||
# run: npm i && npm run build-coupled | ||
|
||
# - name: Build WASM | ||
# working-directory: ./pagefind_web | ||
# run: ./local_build.sh | ||
|
||
# - name: Build UI | ||
# working-directory: ./pagefind_ui/default | ||
# run: npm i && npm run build | ||
|
||
# - name: Build Modular UI | ||
# working-directory: ./pagefind_ui/modular | ||
# run: npm i && npm run build | ||
|
||
# - name: Test Web | ||
# working-directory: ./pagefind_web | ||
# run: cargo test --release | ||
|
||
# - name: Build Testing Binary | ||
# working-directory: ./pagefind | ||
# run: cargo build --release --features extended | ||
|
||
# - name: Upload Testing Binary | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: pagefind-${{ matrix.target }} | ||
# path: target/release/pagefind${{ matrix.build == 'windows' && '.exe' || '' }} | ||
|
||
# - name: Test Lib | ||
# working-directory: ./pagefind | ||
# run: cargo test --release --lib --features extended | ||
|
||
# - name: Test CLI | ||
# run: ./test_ci.sh "release" | ||
|
||
- name: Set up python 3.12 | ||
uses: actions/setup-python@v5 | ||
|
@@ -131,12 +131,9 @@ jobs: | |
- name: Install dev dependencies | ||
run: ./wrappers/python/scripts/ci/github/install_dev_dependencies.sh | ||
|
||
- name: activate venv on windows | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
working-directory: ./wrappers/python | ||
run: .\.venv\Scripts\Activate.ps1 | ||
|
||
- name: activate venv | ||
run: ./wrappers/python/scripts/ci/github/activate_venv.sh | ||
|
||
- name: debug python paths | ||
run: ./wrappers/python/scripts/ci/github/debug_python_paths.sh | ||
|
||
|
@@ -145,18 +142,18 @@ jobs: | |
working-directory: ./wrappers/python | ||
run: | | ||
export VIRTUAL_ENV="$PWD/.venv" | ||
export PATH="$VIRTUAL_ENV/bin:$PATH" | ||
export PATH="$VIRTUAL_ENV/bin:$VIRTUAL_ENV/Scripts:$PATH" | ||
bash ./scripts/ci/python_lints.sh | ||
- name: ensure cog up-to-date | ||
if: runner.os == 'Linux' | ||
# if: runner.os == 'Linux' | ||
working-directory: ./wrappers/python | ||
run: | | ||
export VIRTUAL_ENV="$PWD/.venv" | ||
export PATH="$VIRTUAL_ENV/bin:$PATH" | ||
./scripts/ci/cog/check.sh | ||
- name: Test python API | ||
timeout-minutes: 1 | ||
run: ./wrappers/python/scripts/ci/github/integration_tests.sh | ||
# - name: Test python API | ||
# timeout-minutes: 1 | ||
# run: ./wrappers/python/scripts/ci/github/integration_tests.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
cd wrappers/python | ||
|
||
VIRTUAL_ENV="$PWD/.venv" | ||
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> "$GITHUB_ENV" | ||
|
||
if ! [ -d "$VIRTUAL_ENV" ]; then | ||
echo "No virtualenv found at $VIRTUAL_ENV" | ||
exit 127 | ||
fi | ||
|
||
# Ensure binaries from the virtualenv are available at the start of $PATH | ||
# see https://docs.python.org/3/library/venv.html#creating-virtual-environments | ||
if [ -d "$VIRTUAL_ENV/bin" ]; then | ||
# on unix systems, virtualenv puts executables in .venv/bin | ||
venv_bin_path="$VIRTUAL_ENV/bin" | ||
elif [ -d "$VIRTUAL_ENV/Scripts" ]; then | ||
# on windows, virtualenv places executables in .venv/Scripts | ||
venv_bin_path="$VIRTUAL_ENV/Scripts" | ||
fi | ||
|
||
echo "$venv_bin_path" >> "$GITHUB_PATH" | ||
# see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters