Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Mar 20, 2024
2 parents 5f4e669 + 04e551f commit 29e9789
Show file tree
Hide file tree
Showing 39 changed files with 1,073 additions and 519 deletions.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Thank you for your contribution! -->
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->
<!-- See https://github.com/MobileTeleSystems/evacuator/blob/develop/CONTRIBUTING.rst for help on Contributing -->
<!-- PLEASE DO **NOT** put issue ids in the PR title! Instead, add a descriptive title and put ids in the body -->

## Change Summary

<!-- Please give a short summary of the changes. -->

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this change? -->
<!-- WARNING: please use "fix #123" style references so the issue is closed when this PR is merged. -->

## Checklist

* [ ] Commit message and PR title is comprehensive
* [ ] Keep the change as small as possible
* [ ] Unit and integration tests for the changes exist
* [ ] Tests pass on CI and coverage does not decrease
* [ ] Documentation reflects the changes where applicable
* [ ] `docs/changelog/next_release/<pull request or issue id>.<change type>.rst` file added describing change
(see [CONTRIBUTING.rst](https://github.com/MobileTeleSystems/evacuator/blob/develop/CONTRIBUTING.rst) for details.)
* [ ] My PR is ready to review.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set update schedule for GitHub Actions

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- type:ci
# https://til.simonwillison.net/github/dependabot-python-setup
groups:
github-actions:
patterns:
- '*'
61 changes: 61 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# config for https://github.com/marketplace/actions/github-labeler

- name: attention:help wanted
description: Extra attention is needed
color: bfdadc
from_name: help wanted

- name: attention:invalid
description: This doesn't seem right
color: ea2357
from_name: invalid

- name: ci:skip-changelog
description: Add this label to skip changelog file check
color: 04990f

- name: kind:bug
description: Something isn't working
color: d73a4a
from_name: bug

- name: kind:feature
description: New feature or request
color: 389a3f

- name: kind:improvement
description: Improvement of some existing feature
color: 1a92c2
from_name: enhancement

- name: kind:question
description: Further information is requested
color: 0e857c
from_name: question

- name: resolution:duplicate
description: This issue or pull request already exists
color: cfd3d7
from_name: duplicate

- name: resolution:wontfix
description: This will not be worked on
color: ec103b
from_name: wontfix

- name: type:ci
description: CI-related changes
color: cdb0bd

- name: type:dependency
description: Dependency-related changes
color: 214efe

- name: type:documentation
description: Improvements or additions to documentation
color: 6b9f54
from_name: documentation

- name: type:tests
description: Tests-related changes
color: 5cca5b
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Automerge

on:
pull_request_target:

jobs:
automerge:
name: Enable pull request automerge
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]'

steps:
- uses: alexwilson/enable-github-automerge-action@2.0.0
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
merge-method: REBASE

autoapprove:
name: Automatically approve pull request
needs: [automerge]
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]'

steps:
- uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Changelog

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled, reopened]
branches-ignore:
- master

env:
DEFAULT_PYTHON: '3.12'

permissions:
contents: read

jobs:
check-changelog:
name: Changelog Entry Check
runs-on: ubuntu-latest
timeout-minutes: 10
if: "!contains(github.event.pull_request.labels.*.name, 'ci:skip-changelog') && github.event.pull_request.user.login != 'pre-commit-ci[bot]' && github.event.pull_request.user.login != 'dependabot[bot]'"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-changelog-${{ hashFiles('requirements-docs.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-changelog-${{ hashFiles('requirements-docs.txt') }}
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-changelog-
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel

- name: Install dependencies
run: |
pip install -I requirements-docs.txt
- name: Check changelog entry exists
run: |
if [ ! -s docs/changelog/next_release/${{ github.event.pull_request.number }}.*.rst ]; then
echo "Please add corresponding file 'docs/changelog/next_release/<issue number>.<change type>.rst' with changes description"
exit 1
fi
- name: Validate changelog
run: |
# Fetch the pull request' base branch so towncrier will be able to
# compare the current branch with the base branch.
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
towncrier check --compare-with origin/${{ github.base_ref }}
towncrier --draft
108 changes: 56 additions & 52 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ name: Code analysis
on:
push:
branches:
- develop
- develop
pull_request:
branches-ignore:
- master
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
# flake8-commas is failing on Python 3.12
DEFAULT_PYTHON: '3.11'

jobs:
linters:
name: Linters
Expand All @@ -23,41 +27,41 @@ jobs:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-3.11-codeql-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-python-3.11-codeql-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-3.11-codeql-
${{ runner.os }}-python
${{ runner.os }}-
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel

- name: Install dependencies
run: |
pip install -I -r requirements-dev.txt
# Set the `CODEQL-PYTHON` environment variable to the Python executable
# that includes the dependencies
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
- name: Run flake8
run: python3 -m flake8 --config setup.cfg .

- name: Run mypy
run: python3 -m mypy --config-file setup.cfg evacuator
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-
${{ runner.os }}-python
${{ runner.os }}-
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools wheel

- name: Install dependencies
run: |
pip install -I -r requirements-dev.txt
# Set the `CODEQL-PYTHON` environment variable to the Python executable
# that includes the dependencies
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
- name: Run flake8
run: python3 -m flake8 --config setup.cfg .

- name: Run mypy
run: python3 -m mypy --config-file setup.cfg evacuator

codeql:
name: CodeQL
Expand All @@ -68,21 +72,21 @@ jobs:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:python
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:python
Loading

0 comments on commit 29e9789

Please sign in to comment.