This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
Bump aiohttp from 3.8.6 to 3.9.2 #355
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
db: ["sqlite", "mysql", "postgresql"] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mysql: | |
image: mysql | |
env: | |
MYSQL_DATABASE: root | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup poetry | |
id: poetry_setup | |
uses: ItsDrike/setup-poetry@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
install-args: -E ${{ matrix.db }} --without docs --with github_hooks --sync | |
- name: Compile translations | |
run: | | |
poetry run pybabel compile -d ./locales | |
- name: Run checks | |
run: | | |
# see https://github.com/tk-woven/mypy-install-types-mre | |
mkdir .mypy_cache | |
poetry run make test ci=1 dburi=`\ | |
if [[ "${{ matrix.db }}" == "sqlite" ]]; then \ | |
echo "sqlite+aiosqlite:///{tempdir}/db.sqlite3"; \ | |
elif [[ "${{ matrix.db }}" == "mysql" ]]; then \ | |
echo "mysql+aiomysql://root@localhost/root"; \ | |
elif [[ "${{ matrix.db }}" == "postgresql" ]]; then \ | |
echo "postgresql+asyncpg://postgres:postgres@localhost/postgres"; \ | |
fi` | |
# Upload coverage to codecov: https://codecov.io/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
post-test: | |
runs-on: ubuntu-latest | |
needs: 'test' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup poetry | |
id: poetry_setup | |
uses: ItsDrike/setup-poetry@v1 | |
with: | |
python-version: 3.11 | |
install-args: --only main --only make --only github_hooks --only typing --sync | |
- name: Apply codestyle | |
run: | | |
poetry run make format | |
- name: Commit changes | |
run: | | |
poetry run python .github/commit_and_push.py \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
PerchunPak/pinger-bot \ | |
${{ github.head_ref || github.ref_name }} \ | |
"Apply codestyle :pencil2:" | |
- name: Update poetry.lock | |
continue-on-error: true | |
run: | | |
poetry update --lock | |
- name: Commit changes | |
run: | | |
poetry run python .github/commit_and_push.py \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
PerchunPak/pinger-bot \ | |
${{ github.head_ref || github.ref_name }} \ | |
"Update poetry.lock :chart_with_upwards_trend:" | |
- name: Bump template | |
run: | | |
set -o pipefail | |
function print_conflicts_list() { | |
find . -regex '^.*\.rej$'; | |
} | |
function update_count_of_conflicts() { | |
CONFLICTS_COUNT=$(find . -regex '^.*\.rej$' -printf '.' | wc -c) | |
} | |
echo "::group::Bump template (first try)" | |
cruft update -y | |
echo "::endgroup::" | |
echo "::group::List of conflicts" | |
print_conflicts_list | |
echo "::endgroup::" | |
update_count_of_conflicts | |
if [[ $CONFLICTS_COUNT -gt 0 ]] | |
then | |
echo "::group::Try to resolve conflicts" | |
rm -f poetry.lock.rej poetry.lock | |
git checkout master -- poetry.lock | |
poetry lock --no-update | |
echo "::endgroup::" | |
echo "::group::List of conflicts" | |
print_conflicts_list | |
echo "::endgroup::" | |
update_count_of_conflicts | |
if [[ $CONFLICTS_COUNT -gt 0 ]] | |
then | |
exit 1 | |
fi | |
else | |
echo "No conflicts found" | |
fi | |
- name: Commit changes | |
run: | | |
poetry run python .github/commit_and_push.py \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
PerchunPak/pinger-bot \ | |
${{ github.head_ref || github.ref_name }} \ | |
"Bump template :rocket:" | |
docker: | |
runs-on: ubuntu-latest | |
needs: 'test' | |
strategy: | |
matrix: | |
dialect: ['sqlite', 'mysql', 'postgresql'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: perchunpak | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: perchunpak/pingerbot | |
flavor: | | |
latest=false | |
# semantic versions in another workflow | |
tags: | | |
type=raw,value=latest,enable=${{ matrix.dialect == 'sqlite' }} | |
type=raw,value=latest,suffix=-${{ matrix.dialect }} | |
type=raw,value=dev,enable=${{ matrix.dialect == 'sqlite' }} | |
type=raw,value=dev,suffix=-${{ matrix.dialect }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: dialect=${{ matrix.dialect }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |