@@ -36,10 +36,48 @@ jobs:
36
36
- uses : actions/setup-python@v5
37
37
with :
38
38
python-version : ${{ matrix.python }}
39
+
40
+ - name : Install Nim for interop testing
41
+ if : matrix.toxenv == 'interop'
42
+ run : |
43
+ echo "Installing Nim for nim-libp2p interop testing..."
44
+ curl -sSf https://nim-lang.org/choosenim/init.sh | sh -s -- -y --firstInstall
45
+ echo "$HOME/.nimble/bin" >> $GITHUB_PATH
46
+ echo "$HOME/.choosenim/toolchains/nim-stable/bin" >> $GITHUB_PATH
47
+
48
+ - name : Cache nimble packages
49
+ if : matrix.toxenv == 'interop'
50
+ uses : actions/cache@v4
51
+ with :
52
+ path : |
53
+ ~/.nimble
54
+ ~/.choosenim/toolchains/*/lib
55
+ key : ${{ runner.os }}-nimble-${{ hashFiles('**/nim_echo_server.nim') }}
56
+ restore-keys : |
57
+ ${{ runner.os }}-nimble-
58
+
59
+ - name : Build nim interop binaries
60
+ if : matrix.toxenv == 'interop'
61
+ run : |
62
+ export PATH="$HOME/.nimble/bin:$HOME/.choosenim/toolchains/nim-stable/bin:$PATH"
63
+ cd tests/interop/nim_libp2p
64
+ ./scripts/setup_nim_echo.sh
65
+
39
66
- run : |
40
67
python -m pip install --upgrade pip
41
68
python -m pip install tox
42
- - run : |
69
+
70
+ - name : Run Tests or Generate Docs
71
+ run : |
72
+ if [[ "${{ matrix.toxenv }}" == 'docs' ]]; then
73
+ export TOXENV=docs
74
+ else
75
+ export TOXENV=py${{ matrix.python }}-${{ matrix.toxenv }}
76
+ fi
77
+ # Set PATH for nim commands during tox
78
+ if [[ "${{ matrix.toxenv }}" == 'interop' ]]; then
79
+ export PATH="$HOME/.nimble/bin:$HOME/.choosenim/toolchains/nim-stable/bin:$PATH"
80
+ fi
43
81
python -m tox run -r
44
82
45
83
windows :
0 commit comments