Skip to content

Commit

Permalink
Fix Solutions CI (#59)
Browse files Browse the repository at this point in the history
* install extras

* change cache name

* set python=3.11 and use parallel tests

* fix import

* fix path
  • Loading branch information
juliusfrost committed May 4, 2023
1 parent d3a9bfe commit 554713b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-solutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
Expand All @@ -43,18 +43,18 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-solutions-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
run: poetry install --all-extras --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction
run: poetry install --all-extras --no-interaction
#----------------------------------------------
# run linter
#----------------------------------------------
Expand All @@ -66,4 +66,4 @@ jobs:
#----------------------------------------------
- name: Run pytest
run: |
poetry run pytest
poetry run pytest -n auto
6 changes: 3 additions & 3 deletions src/week06/homework/test_exploitable_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
from src.utils import network
from src.utils.mock import MockChainContext, MockUser
from src.week06 import lecture_dir, homework_dir
from src.week06.homework import fixed_swap_solved
from src.week06.homework import fixed_swap
from src.week06.lecture import exploitable_swap

# build script once outside test function
exploitable_swap_script = build(lecture_dir.joinpath("exploitable_swap.py"))
fixed_swap_script = build(homework_dir.joinpath("fixed_swap_solved.py"))
fixed_swap_script = build(homework_dir.joinpath("fixed_swap.py"))

script_dict = {
"exploitable_swap": [exploitable_swap_script, exploitable_swap],
"fixed_swap": [fixed_swap_script, fixed_swap_solved],
"fixed_swap": [fixed_swap_script, fixed_swap],
}


Expand Down

0 comments on commit 554713b

Please sign in to comment.