diff --git a/.github/workflows/chore.yml b/.github/workflows/chore.yml new file mode 100644 index 00000000..7a7b6d8e --- /dev/null +++ b/.github/workflows/chore.yml @@ -0,0 +1,39 @@ +name: Chore checks + +on: + push: + branches-ignore: ["main"] + pull_request: + branches-ignore: ["main"] + +jobs: + fixup-commits: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check absence of fixup commits + run: | + ! git log --pretty=format:%s | grep 'fixup!' + + check-changelog: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check that the CHANGELOG has been modified in the current branch + run: | + git diff --name-only origin/main | grep CHANGELOG + + lint-changelog: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Check CHANGELOG max line length + run: | + test $(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com/MTES-MCT/qualicharge" | wc -L) -le 80 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 15650155..3b52dd3c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,17 +2,15 @@ name: Docker Image CI on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: make build + - uses: actions/checkout@v4 + - name: Build the Docker image + run: make build diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 65a0073b..36076e3c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,30 +5,29 @@ name: Python application on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read jobs: - build-api: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Install Pipenv - run: pipx install pipenv - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pipenv" - - name: Install dependencies - run: | - cd src/api - pipenv install -de . + - uses: actions/checkout@v4 + - name: Install Pipenv + run: pipx install pipenv + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pipenv" + - name: Install dependencies + run: | + cd src/api + pipenv install -de . lint-api: needs: build-api @@ -37,20 +36,20 @@ jobs: run: working-directory: ./src/api steps: - - uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pipenv" - - name: Lint with Black - run: pipenv run black qualicharge tests - - name: Lint with Ruff - run: pipenv run ruff check qualicharge tests - - name: Lint with MyPy - run: pipenv run mypy qualicharge tests + - uses: actions/checkout@v4 + - name: Install pipenv + run: pipx install pipenv + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pipenv" + - name: Lint with Black + run: pipenv run black qualicharge tests + - name: Lint with Ruff + run: pipenv run ruff check qualicharge tests + - name: Lint with MyPy + run: pipenv run mypy qualicharge tests test-api: needs: build-api @@ -59,13 +58,13 @@ jobs: run: working-directory: ./src/api steps: - - uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "pipenv" - - name: Test with pytest - run: pipenv run pytest + - uses: actions/checkout@v4 + - name: Install pipenv + run: pipx install pipenv + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pipenv" + - name: Test with pytest + run: pipenv run pytest diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..59626d59 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +- Implement base FastAPI app + +[unreleased]: https://github.com/MTES-MCT/qualicharge/compare/dc6a9e2...HEAD