diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index f462e508..2be285bf 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -66,60 +66,60 @@ jobs: - name: Check Conda version run: conda info --all - - name: Install pipenv - run: pip install pipenv - - - name: Check pipenv version - run: pipenv --version - - - name: Install virtualenvwrapper - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - pip install virtualenvwrapper - echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - shell: bash - - - name: Install virtualenvwrapper-win - if: startsWith( matrix.os, 'windows') - run: | - pip install virtualenvwrapper-win - echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV - shell: bash - - - name: Install pyenv - if: startsWith( matrix.os, 'windows') - run: | - choco install pyenv-win -y - echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV - echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - shell: bash - - - name: Install pyenv and pyenv-virtualenv - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - curl https://pyenv.run | bash - echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV - echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV - shell: bash - - - name: Check Pyenv version - run: pyenv --version - shell: bash - - - name: Install Pyenv Python(s) - if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') - run: | - pyenv install --list - pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 - shell: bash - - # pyenv-win install list has not updated for a while - - name: Install Pyenv Python(s) - if: startsWith( matrix.os, 'windows') - run: | - pyenv install --list - pyenv install 3.10.5 3.9.13 3.8.10 - shell: bash + # - name: Install pipenv + # run: pip install pipenv + + # - name: Check pipenv version + # run: pipenv --version + + # - name: Install virtualenvwrapper + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # pip install virtualenvwrapper + # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + # shell: bash + + # - name: Install virtualenvwrapper-win + # if: startsWith( matrix.os, 'windows') + # run: | + # pip install virtualenvwrapper-win + # echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV + # shell: bash + + # - name: Install pyenv + # if: startsWith( matrix.os, 'windows') + # run: | + # choco install pyenv-win -y + # echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV + # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + # shell: bash + + # - name: Install pyenv and pyenv-virtualenv + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # curl https://pyenv.run | bash + # echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV + # echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV + # shell: bash + + # - name: Check Pyenv version + # run: pyenv --version + # shell: bash + + # - name: Install Pyenv Python(s) + # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') + # run: | + # pyenv install --list + # pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 + # shell: bash + + # # pyenv-win install list has not updated for a while + # - name: Install Pyenv Python(s) + # if: startsWith( matrix.os, 'windows') + # run: | + # pyenv install --list + # pyenv install 3.10.5 3.9.13 3.8.10 + # shell: bash - name: Rust Tool Chain setup uses: dtolnay/rust-toolchain@stable @@ -132,66 +132,66 @@ jobs: shell: bash - name: Run Tests - run: cargo test --frozen --all-features + run: cargo test --frozen --all-features -- --nocapture shell: bash - name: Find Environments if: matrix.run_cli == 'yes' run: cargo run --release --target ${{ matrix.target }} shell: bash - - builds: - name: Builds - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - os: windows-latest - target: aarch64-pc-windows-msvc - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - run_cli: "yes" - # - os: ubuntu-latest - # target: aarch64-unknown-linux-gnu - # - os: ubuntu-latest - # target: arm-unknown-linux-gnueabihf - - os: macos-latest - target: x86_64-apple-darwin - run_cli: "yes" - - os: macos-14 - target: aarch64-apple-darwin - run_cli: "yes" - # - os: ubuntu-latest - # target: x86_64-unknown-linux-gnu - # - os: ubuntu-latest - # target: aarch64-unknown-linux-musl - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Rust Tool Chain setup - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - targets: ${{ matrix.target }} - - - name: Cargo Fetch - run: cargo fetch - shell: bash - - - name: Run Tests - run: cargo test --frozen --all-features - shell: bash - - - name: Build - run: cargo build --release --target ${{ matrix.target }} - shell: bash - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: pet-${{ matrix.target }} - path: target/${{ matrix.target }}/release/pet* + # builds: + # name: Builds + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # include: + # - os: windows-latest + # target: x86_64-pc-windows-msvc + # - os: windows-latest + # target: aarch64-pc-windows-msvc + # - os: ubuntu-latest + # target: x86_64-unknown-linux-musl + # run_cli: "yes" + # # - os: ubuntu-latest + # # target: aarch64-unknown-linux-gnu + # # - os: ubuntu-latest + # # target: arm-unknown-linux-gnueabihf + # - os: macos-latest + # target: x86_64-apple-darwin + # run_cli: "yes" + # - os: macos-14 + # target: aarch64-apple-darwin + # run_cli: "yes" + # # - os: ubuntu-latest + # # target: x86_64-unknown-linux-gnu + # # - os: ubuntu-latest + # # target: aarch64-unknown-linux-musl + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Rust Tool Chain setup + # uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: stable + # targets: ${{ matrix.target }} + + # - name: Cargo Fetch + # run: cargo fetch + # shell: bash + + # - name: Run Tests + # run: cargo test --frozen --all-features + # shell: bash + + # - name: Build + # run: cargo build --release --target ${{ matrix.target }} + # shell: bash + + # - name: Upload Artifact + # uses: actions/upload-artifact@v4 + # with: + # name: pet-${{ matrix.target }} + # path: target/${{ matrix.target }}/release/pet* diff --git a/Cargo.lock b/Cargo.lock index 95e273da..4cb7be77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,6 +190,12 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +[[package]] +name = "needs_env_var" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4993ef217a71dd939d08c47d0230bfca02aeedcf108c46c800eb60caa51dc467" + [[package]] name = "pet" version = "0.1.0" @@ -219,6 +225,7 @@ version = "0.1.0" dependencies = [ "lazy_static", "log", + "needs_env_var", "pet-core", "pet-utils", "regex", diff --git a/crates/pet-conda/Cargo.toml b/crates/pet-conda/Cargo.toml index aefc3235..75ee98aa 100644 --- a/crates/pet-conda/Cargo.toml +++ b/crates/pet-conda/Cargo.toml @@ -11,3 +11,6 @@ pet-core = { path = "../pet-core" } pet-utils = { path = "../pet-utils" } log = "0.4.21" regex = "1.10.4" + +[dev-dependencies] +needs_env_var = "1.0.0" \ No newline at end of file diff --git a/crates/pet-conda/tests/ci_test.rs b/crates/pet-conda/tests/ci_test.rs index a0623878..14787e7e 100644 --- a/crates/pet-conda/tests/ci_test.rs +++ b/crates/pet-conda/tests/ci_test.rs @@ -2,9 +2,11 @@ // Licensed under the MIT License. mod common; +use needs_env_var::needs_env_var; #[cfg(unix)] #[test] +#[needs_env_var(CI)] fn conda_ci() { use pet_conda::Conda; use pet_core::{os_environment::EnvironmentApi, Locator}; @@ -16,3 +18,4 @@ fn conda_ci() { println!("SERVER CI Started"); println!("SERVER CI REsults{:?}", result); } + \ No newline at end of file