diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b57547..6c1644e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: tests: name: CI (Python ${{ matrix.python }} on ${{ matrix.os }}, ${{ matrix.type }} test) runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash strategy: matrix: python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] @@ -32,15 +29,19 @@ jobs: id: python with: python-version: ${{ matrix.python }} - - name: Install solc-select + - name: Create Python virtual environment run: | ${{ steps.python.outputs.python-path }} -m venv test-venv - source test-venv/bin/activate + - name: Install solc-select + shell: bash + run: | + source test-venv/${{ (runner.os == 'Windows' && 'Scripts') || 'bin' }}/activate pip3 install . - name: Run Tests + shell: bash env: TEST_TYPE: ${{ (matrix.type != 'os_specific' && matrix.type) || runner.os }} run: | - source test-venv/bin/activate + source test-venv/${{ (runner.os == 'Windows' && 'Scripts') || 'bin' }}/activate TEST_TYPE="$(echo "$TEST_TYPE" | tr '[:upper:]' '[:lower:]')" bash scripts/test_${TEST_TYPE}.sh diff --git a/scripts/test_solc.sh b/scripts/test_solc.sh index 6bacea9..55b3978 100644 --- a/scripts/test_solc.sh +++ b/scripts/test_solc.sh @@ -92,7 +92,7 @@ if [[ "$execute" != *"Error: Explicit type conversion not allowed"* ]]; then fi echo "SUCCESS: solc080_fail_compile" -UNINSTALL_PATH=$HOME/.solc-select/artifacts/solc-0.8.9 +UNINSTALL_PATH=${VIRTUAL_ENV:-$HOME}/.solc-select/artifacts/solc-0.8.9 rm -rf $UNINSTALL_PATH{,.exe} # uninstall solc 0.8.9 execute=$(solc-select use 0.8.9 --always-install) if [[ "$execute" != *"Switched global version to 0.8.9"* ]]; then @@ -101,7 +101,7 @@ if [[ "$execute" != *"Switched global version to 0.8.9"* ]]; then fi echo "SUCCESS: use - always install" -UNINSTALL_PATH=$HOME/.solc-select/artifacts/solc-0.8.1 +UNINSTALL_PATH=${VIRTUAL_ENV:-$HOME}/.solc-select/artifacts/solc-0.8.1 rm -rf $UNINSTALL_PATH{,.exe} # uninstall solc 0.8.1 execute=$(solc-select use 0.8.1 2>&1 || true) if [[ $execute != *"'0.8.1' must be installed prior to use"* ]]; then