diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 42306a9..368170a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -23,18 +23,12 @@ jobs: **/*.py - name: Prepare python env if: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - python -m venv env - source env/bin/activate - pip install -U pip - pip install -r test-requirements.txt + run: pip3 install -r requirements.devel.txt - name: Run unit tests (pytest) if: ${{ steps.changed-files.outputs.all_changed_files }} - run: bash -o pipefail -c 'source - env/bin/activate && pip3 install -r requirements.txt && - pytest -vv --cov-report term-missing:skip-covered - --cov-report xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml --cov=alma_tests_cacher - tests/ | tee /tmp/pytest-coverage.txt' + run: pytest -v --cov + --cov-report xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml + --cov-report term-missing:skip-covered | tee /tmp/pytest-coverage.txt - name: Pytest coverage comment if: ${{ steps.changed-files.outputs.all_changed_files }} uses: MishaKav/pytest-coverage-comment@main diff --git a/.github/workflows/syntax.yml b/.github/workflows/syntax.yml index a2a0dbc..3a6537a 100644 --- a/.github/workflows/syntax.yml +++ b/.github/workflows/syntax.yml @@ -20,21 +20,15 @@ jobs: **/*.py - name: Prepare python env if: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - python -m venv env - source env/bin/activate - pip install -U pip - pip install -r test-requirements.txt - pip install isort[colors] colorama black pylint + run: pip3 install -r requirements.devel.txt - name: Run pylint id: pylint if: ${{ steps.changed-files.outputs.all_changed_files }} run: | - delimiter='$(openssl rand -hex 8)' - echo 'report<<$(delimiter)' >> $GITHUB_OUTPUT - source env/bin/activate + delimiter=$(openssl rand -hex 8) + echo "report<<$delimiter" >> $GITHUB_OUTPUT pylint ${{ steps.changed-files.outputs.all_changed_files }} --exit-zero >> $GITHUB_OUTPUT - echo '$(delimiter)' >> $GITHUB_OUTPUT + echo $delimiter >> $GITHUB_OUTPUT - name: Post pylint output uses: mshick/add-pr-comment@v2 if: ${{ steps.changed-files.outputs.all_changed_files }} @@ -50,7 +44,7 @@ jobs: message-id: pylint-report - name: Run black if: ${{ steps.changed-files.outputs.all_changed_files }} - run: env/bin/black ${{ steps.changed-files.outputs.all_changed_files }} --check --diff --color + run: black ${{ steps.changed-files.outputs.all_changed_files }} --check --diff --color - name: Run isort if: ${{ steps.changed-files.outputs.all_changed_files }} - run: env/bin/isort ${{ steps.changed-files.outputs.all_changed_files }} --diff --color --check-only + run: isort ${{ steps.changed-files.outputs.all_changed_files }} --diff --color --check-only diff --git a/.gitignore b/.gitignore index b262089..bd67229 100644 --- a/.gitignore +++ b/.gitignore @@ -159,4 +159,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ diff --git a/Dockerfile b/Dockerfile index 6eaf7fe..8f29877 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,26 @@ FROM almalinux:9 -RUN mkdir -p /code && \ - dnf update -y && \ - dnf install git -y && \ - dnf clean all -RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -o wait_for_it.sh && chmod +x wait_for_it.sh -COPY ./requirements.txt /code/requirements.txt -RUN cd /code && python3 -m venv env && source env/bin/activate && \ - pip3 install --upgrade pip && pip3 install -r /code/requirements.txt --no-cache-dir +RUN <> ~/.ssh/config +EOT + +RUN <