test renaming docker

This commit is contained in:
leehk 2025-04-13 21:23:11 +08:00
parent 39b52fafac
commit 41e49d9b48

View File

@ -108,13 +108,11 @@ jobs:
run: | run: |
docker run \ docker run \
-d \ -d \
--name backend \ --name backend-backend \
-e PORT=8765 \ -e PORT=8765 \
-e ENVIRONMENT=dev \ -e ENVIRONMENT=dev \
-e TESTING=0 \ -e TESTING=0 \
-p 8004:8765 \ -p 8004:8765 \
--memory="4g" \
--memory-swap="8g" \
${{ env.IMAGE }}:latest ${{ env.IMAGE }}:latest
- name: Monitor memory usage - name: Monitor memory usage
run: free -h run: free -h
@ -125,13 +123,13 @@ jobs:
sudo apt-get install -y python3.11 python3.11-distutils sudo apt-get install -y python3.11 python3.11-distutils
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pipenv && cd ./app/backend/ && pipenv install && pipenv run python -m pytest --disable-warnings pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pipenv && cd ./app/backend/ && pipenv install && pipenv run python -m pytest --disable-warnings
- name: Pytest - name: Pytest
run: docker exec backend pipenv run python -m pytest -v run: docker exec backend-backend pipenv run python -m pytest -v
# - name: Flake8 # - name: Flake8
# run: docker exec backend pipenv run python -m flake8 . # run: docker exec backend-backend pipenv run python -m flake8 .
# - name: Black # - name: Black
# run: docker exec backend pipenv run python -m black . --check # run: docker exec backend-backend pipenv run python -m black . --check
# - name: isort # - name: isort
# run: docker exec backend pipenv run python -m isort . --check-only # run: docker exec backend-backend pipenv run python -m isort . --check-only
- name: Cleanup container at end of job - name: Cleanup container at end of job
if: always() if: always()
run: docker stop backend || true && docker rm backend || true run: docker stop backend-backend || true && docker rm backend-backend || true