Skip to content

Commit

Permalink
ci: fix execution on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Jan 3, 2025
1 parent 907550f commit ba4e248
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -32,15 +29,20 @@ 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
python3 -m pip install --upgrade pip
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
4 changes: 2 additions & 2 deletions scripts/test_solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ba4e248

Please sign in to comment.