@@ -17,14 +17,14 @@ jobs:
1717 steps :
1818
1919 - name : Check out code into the Go module directory
20- uses : actions/checkout@v3
20+ uses : actions/checkout@v4
2121 with :
2222 fetch-depth : 0
2323
2424 - name : Set up Go
25- uses : actions/setup-go@v4
25+ uses : actions/setup-go@v5
2626 with :
27- go-version : 1.21.7
27+ go-version-file : go.mod
2828
2929 - name : Build
3030 run : |
@@ -38,21 +38,25 @@ jobs:
3838 env :
3939 RICHGO_FORCE_COLOR : 1
4040
41- - name : Cache virtualenvs
42- id : cache-pipenv
43- uses : actions/cache@v3
41+ - name : Install uv
42+ uses : astral-sh/setup-uv@v5
4443 with :
45- path : ~/.local/share/virtualenvs
46- key : ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
44+ version : 0.5.24
45+ enable-cache : true
46+ cache-dependency-glob : " test/uv.lock"
47+
48+ - name : " Set up Python"
49+ uses : actions/setup-python@v5
50+ with :
51+ python-version-file : " test/.python-version"
52+
53+ - name : Install the project
54+ working-directory : ./test
55+ run : uv sync --all-extras --dev
4756
4857 - name : Install functional test dependencies
4958 run : |
5059 docker network create net-test
51- python3 -m pip install --upgrade pipenv wheel
52- pipenv install --deploy
53- # some tests need root, so we have to install pytest twice
54- sudo python3 -m pip install --upgrade pipenv wheel
55- sudo pipenv install --deploy
5660
5761 - name : Run functional tests
5862 env :
@@ -61,18 +65,26 @@ jobs:
6165 CROWDSEC_TEST_NETWORK : net-test
6266 CROWDSEC_TEST_TIMEOUT : 60
6367 PYTEST_ADDOPTS : --durations=0 -vv --color=yes -m "not (deb or rpm)"
68+ working-directory : ./test
6469 run : |
6570 # everything except for
6671 # - install (requires root, ignored by default)
6772 # - deb/rpm (on their own workflows)
68- pipenv run pytest
73+ uv run pytest
6974 # these need root
70- sudo -E pipenv run pytest ./test /install/no_crowdsec
75+ sudo -E $(which uv) run pytest ./tests /install/no_crowdsec
7176 # these need a running crowdsec
7277 docker run -d --name crowdsec -e CI_TESTING=true -e DISABLE_ONLINE_API=true -p 8080:8080 -ti crowdsecurity/crowdsec
7378 install -m 0755 /dev/stdin /usr/local/bin/cscli <<'EOT'
7479 #!/bin/sh
7580 docker exec crowdsec cscli "$@"
7681 EOT
7782 sleep 5
78- sudo -E pipenv run pytest ./test/install/with_crowdsec
83+ sudo -E $(which uv) run pytest ./tests/install/with_crowdsec
84+
85+ - name : Lint
86+ working-directory : ./test
87+ run : |
88+ uv run ruff check
89+ uv run basedpyright
90+
0 commit comments