From 97e5e268768b73cae829d112b12c8154099aa13f Mon Sep 17 00:00:00 2001 From: Stefan Borer Date: Wed, 3 Mar 2021 11:10:50 +0100 Subject: [PATCH] chore: move to gh action, dependabot --- .dependabot/config.yml | 22 ++++++++++ .github/workflows/auto-approve-dependabot.yml | 13 ++++++ .github/workflows/tests.yml | 40 +++++++++++++++++++ .gitlint | 4 ++ .travis.yml | 39 ------------------ renovate.json | 5 --- 6 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 .dependabot/config.yml create mode 100644 .github/workflows/auto-approve-dependabot.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml delete mode 100644 renovate.json diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 00000000..69bcecf2 --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,22 @@ +version: 1 +update_configs: + - package_manager: "python" + directory: "/" + update_schedule: "live" + automerged_updates: + - match: + dependency_type: "development" + update_type: "semver:minor" + commit_message: + prefix: "chore" + include_scope: true + - package_manager: "docker" + directory: "/" + update_schedule: "daily" + commit_message: + prefix: "chore" + include_scope: true + ignored_updates: + - match: + dependency_name: "python" + version_requirement: ">=3.7" diff --git a/.github/workflows/auto-approve-dependabot.yml b/.github/workflows/auto-approve-dependabot.yml new file mode 100644 index 00000000..70b75377 --- /dev/null +++ b/.github/workflows/auto-approve-dependabot.yml @@ -0,0 +1,13 @@ +name: Auto approve dependabot + +on: + pull_request_target + +jobs: + auto-approve: + runs-on: ubuntu-latest + steps: + - uses: hmarr/auto-approve-action@v2 + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..cb73f813 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,40 @@ +name: Tests + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0' + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build the project + run: | + echo "UID=$(id --user)" > .env + docker-compose up -d --build + - name: Lint the code + run: | + docker-compose exec -T interval black --check . + docker-compose exec -T interval flake8 + - name: Run pytest + run: | + docker-compose exec -T interval wait-for-it.sh db:5432 + docker-compose exec -T interval wait-for-it.sh caluma:8000 + docker-compose exec -T interval pytest --no-cov-on-fail --cov + gitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.7' + - name: Install gitlint + run: pip install gitlint + - name: Run gitlint + run: gitlint --contrib contrib-title-conventional-commits diff --git a/.gitlint b/.gitlint index 86c71b6a..4c07752f 100644 --- a/.gitlint +++ b/.gitlint @@ -1,2 +1,6 @@ [general] ignore=body-is-missing + +[ignore-by-title] +regex=^chore\(deps.* +ignore=title-max-length, body-is-missing, body-max-line-length, body-min-length diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 583cd972..00000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: python - -python: - - "3.6" - -services: - - docker - -env: - global: - - DOCKER_COMPOSE_VERSION=1.23.1 - -jobs: - include: - - stage: tests - name: "Tests" - before_install: - # install newer compose version - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - - # Workaround for https://github.com/travis-ci/travis-ci/issues/4842 - # Let's stop postgresql - - sudo service postgresql stop - # wait for postgresql to shutdown - - while sudo lsof -Pi :5432 -sTCP:LISTEN -t; do sleep 1; done - install: - - docker-compose up -d --build - - pip install $(grep "gitlint" ./requirements-dev.txt) - script: - - docker-compose up -d db caluma - - docker-compose run --rm interval black --check . - - docker-compose run --rm interval flake8 - - gitlint --commits ${TRAVIS_BRANCH}..HEAD lint - - docker-compose run --rm interval wait-for-it.sh db:5432 - - docker-compose run --rm interval wait-for-it.sh caluma:8000 - - docker-compose run --rm interval pytest --no-cov-on-fail --cov diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 62e3b19e..00000000 --- a/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "github>projectcaluma/renovate-config" - ] -}