Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
ignore = DCO010, DCO023, DOC602, DOC603, E203, E501, E712, F401, F403, F821, W503
ignore = DCO010, DCO023, DOC503, DOC602, DOC603, MDA002, E203, E501, E712, F401, F403, F821, W503
style = google
skip-checking-short-docstrings = False
skip-checking-short-docstrings = False
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
open-pull-requests-limit: 10
25 changes: 0 additions & 25 deletions .github/workflows/black.yml

This file was deleted.

147 changes: 147 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Test and build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
codeValidation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install pip
run: |
python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile)
- name: Install pipenv
run: |
PIPENV_VERSION=$(sed -nE 's/pipenv = "==(.*)"/\1/p' Pipfile)
python -m pip install pipenv==$PIPENV_VERSION
- name: Install from pipfile
run: |
pipenv install --system
- name: Analysing the code with black
run: |
black $(git rev-parse --show-toplevel) --check
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- name: Check for CRLF line endings
run: |
for file in $(git ls-files); do
if grep -q $'\r$' "$file"; then
echo "$file has faulty file endings"
fi
done
if git grep -I --name-only $'\r'; then
echo "CRLF line endings detected"
exit 1
fi
- name: Analysing the code with flake8
run: |
flake8 $(git rev-parse --show-toplevel)
- name: Analysing the code with isort
run: |
isort --check-only $(git rev-parse --show-toplevel)/ --profile black
- name: Running pytest
run: |
cd techsupport_bot
python3.11 -m pytest tests/ -p no:warnings

containerBuild:
runs-on: ubuntu-latest
needs:
- codeValidation
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: make establish_config && docker build -f Dockerfile . -t techsupportbot:$(date +%s)

close_pyTest:
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- codeValidation
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge PR
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' && steps.dependabot-metadata.outputs.dependency-names == 'pytest'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

close_pyLint:
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- codeValidation
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge PR
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' && steps.dependabot-metadata.outputs.dependency-names == 'pylint'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

close_flake8:
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- codeValidation
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge PR
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' && steps.dependabot-metadata.outputs.dependency-names == 'flake8'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

close_isort:
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- codeValidation
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge PR
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' && steps.dependabot-metadata.outputs.dependency-names == 'isort'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 0 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '31 18 * * 1'
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/docker-image.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/flake8.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/isort.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/lfendings.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/pylint.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/pytest.yml

This file was deleted.

1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ disable=C0103,
R0914,
R0915,
R0916,
R0917,
W0201,
W0231,
W0406,
Expand Down
Loading
Loading