Skip to content

Commit

Permalink
ci: use a venv instead of system-wide installs
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Jan 3, 2025
1 parent 27072aa commit 907550f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: python
with:
python-version: ${{ matrix.python }}
- name: Install solc-select
run: |
${{ (matrix.os != 'windows-2022' && 'sudo pip install .') || 'pip install . --user' }}
solc-select install all
${{ steps.python.outputs.python-path }} -m venv test-venv
source test-venv/bin/activate
pip3 install .
- name: Run Tests
env:
TEST_TYPE: ${{ (matrix.type != 'os_specific' && matrix.type) || runner.os }}
run: |
source test-venv/bin/activate
TEST_TYPE="$(echo "$TEST_TYPE" | tr '[:upper:]' '[:lower:]')"
bash scripts/test_${TEST_TYPE}.sh
1 change: 0 additions & 1 deletion scripts/test_linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

sudo pip3 install .
solc-select install all

use_version=$(solc-select use 0.4.0)
Expand Down
2 changes: 2 additions & 0 deletions scripts/test_macos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

solc-select install all

use_version=$(solc-select use 0.3.6)
if [[ $use_version != "Switched global version to 0.3.6"* ]]; then
echo "OS X FAILED: set minimum version"
Expand Down
2 changes: 2 additions & 0 deletions scripts/test_solc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

solc-select install 0.4.5 0.5.0 0.6.0 0.7.0 0.8.0 0.8.1 0.8.9

## solc 0.4.5 ##
solc-select use 0.4.5 &> /dev/null
solc ./scripts/solidity_tests/solc045_success.sol
Expand Down
7 changes: 4 additions & 3 deletions scripts/test_solc_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
set -euo pipefail

### Install old version of solc
sudo pip3 uninstall --yes solc-select
sudo pip3 install solc-select
pip3 uninstall --yes solc-select
pip3 install solc-select
solc-select use 0.8.0 --always-install
old_solc_version=$(solc --version)
solc-select install 0.4.11 0.5.0 0.6.12 0.7.3 0.8.3
all_old_versions=$(solc-select versions | sort)

### Install new version of solc
sudo pip3 install -e .
pip3 uninstall --yes solc-select
pip3 install -e .
new_solc_version=$(solc --version)
all_new_versions=$(solc-select versions | sort)

Expand Down
2 changes: 2 additions & 0 deletions scripts/test_windows.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

solc-select install all

use_version=$(solc-select use 0.4.5)
if [[ $use_version != "Switched global version to 0.4.5"* ]]; then
echo "WINDOWS FAILED: minimum version"
Expand Down

0 comments on commit 907550f

Please sign in to comment.