generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
283 additions
and
58 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Check if the config schema and the example are up to date | ||
|
||
on: push | ||
|
||
jobs: | ||
get-changed-services: | ||
uses: ./.github/workflows/get_affected_services.yaml | ||
|
||
check-config: | ||
name: Check config schema and example | ||
needs: get-changed-services | ||
if: ${{ needs.get-changed-services.outputs.since-last-commit != '' }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
service: ${{ fromJson(needs.get-changed-services.outputs.since-last-commit) }} | ||
fail-fast: false | ||
|
||
env: | ||
IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml | ||
IRS_CONFIG_YAML: ./services/irs/dev_config.yaml | ||
PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update pip and pyopenssl | ||
id: pip-update | ||
run: python -m pip install --upgrade pip && pip install --upgrade pyopenssl | ||
|
||
- name: Install dependencies | ||
id: install-dependencies | ||
run: pip install --no-deps -r ./lock/requirements-dev.txt && pip install --no-deps ./services/${{matrix.service}} | ||
|
||
- name: Check config docs | ||
id: check-config-docs | ||
run: | | ||
python3 ./scripts/update_config_docs.py --check ${{matrix.service}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This file is only needed if your repository uses FastAPI | ||
name: Check if OpenAPI spec is up to date | ||
|
||
on: push | ||
|
||
jobs: | ||
get-changed-services: | ||
uses: ./.github/workflows/get_affected_services.yaml | ||
|
||
check-openapi-specs: | ||
name: Check config schema and example | ||
needs: get-changed-services | ||
if: ${{ needs.get-changed-services.outputs.since-last-commit != '' }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
service: ${{ fromJson(needs.get-changed-services.outputs.since-last-commit) }} | ||
fail-fast: false | ||
|
||
env: | ||
IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml | ||
IRS_CONFIG_YAML: ./services/irs/dev_config.yaml | ||
PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update pip and install dependencies | ||
id: install-dependencies | ||
run: python -m pip install --upgrade pip && pip install --no-deps -r ./lock/requirements-dev.txt && pip install --no-deps ./services/${{matrix.service}} | ||
|
||
- name: Check openapi.yaml | ||
id: check-openapi-docs | ||
run: | | ||
python3 ./scripts/update_openapi_docs.py --check ${{matrix.service}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check if pyproject.toml file is up to date | ||
|
||
on: push | ||
|
||
jobs: | ||
static-code-analysis: | ||
name: Check pyproject file | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update pip and install dependencies | ||
id: install-dependencies | ||
run: python -m pip install --upgrade pip && pip install --no-deps -r ./lock/requirements-dev.txt | ||
|
||
- name: Check pyproject.toml | ||
id: check-pyproject | ||
run: | | ||
./scripts/update_pyproject.py --check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Check if the README files are up to date | ||
|
||
on: push | ||
|
||
jobs: | ||
get-changed-services: | ||
uses: ./.github/workflows/get_affected_services.yaml | ||
|
||
check-repo-readme: | ||
name: Check repository README file | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update pip and install dependencies | ||
id: install-dependencies | ||
run: python -m pip install --upgrade pip && pip install --no-deps -r ./lock/requirements-dev.txt | ||
|
||
- name: Check top level README | ||
id: check-main-readme | ||
run: | | ||
python3 scripts/update_readme_monorepo.py --check | ||
check-service-readme: | ||
name: Check README file for ${{matrix.service}} | ||
needs: get-changed-services | ||
if: ${{ needs.get-changed-services.outputs.all-changes != '' }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
service: ${{ fromJson(needs.get-changed-services.outputs.since-last-commit) }} | ||
fail-fast: false | ||
env: | ||
IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml | ||
IRS_CONFIG_YAML: ./services/irs/dev_config.yaml | ||
PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update pip and install dependencies | ||
id: install-dependencies | ||
run: python -m pip install --upgrade pip && pip install --no-deps -r ./lock/requirements-dev.txt | ||
|
||
- name: Check service level READMEs | ||
id: check-service-readmes | ||
run: | | ||
python3 scripts/update_readme_services.py --check --service ${{matrix.service}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Get services affected by changes | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
all-changes: | ||
description: "Services affected by changes for all commits on branch" | ||
value: ${{ jobs.get_changed_services_pr.outputs.services }} | ||
since-last-commit: | ||
description: "Services affected by changes since last commit" | ||
value: ${{ jobs.get_changed_services_commit.outputs.services }} | ||
|
||
jobs: | ||
get_changed_services_commit: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
services: ${{ steps.services-changed.outputs.affected }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
|
||
- name: Install Typer to check changed services | ||
id: install-typer | ||
run: pip install typer>=0.9.0 | ||
|
||
- name: Generate list of changed services | ||
id: services-changed | ||
run: | | ||
echo "affected=$(python3 ./scripts/get_affected_services.py ${{ steps.changed-files.outputs.all_changed_files }} )" >> $GITHUB_OUTPUT | ||
get_changed_services_pr: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
services: ${{ steps.services-changed.outputs.affected }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
|
||
- name: Install Typer to check changed services | ||
id: install-typer | ||
run: pip install typer>=0.9.0 | ||
|
||
- name: Generate list of changed services | ||
id: services-changed | ||
run: | | ||
echo "affected=$(python3 ./scripts/get_affected_services.py ${{ steps.changed-files.outputs.all_changed_files }} )" >> $GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Static Code Analysis | ||
|
||
on: push | ||
|
||
jobs: | ||
static-code-analysis: | ||
name: Static Code Analysis | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.9 | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/action@v3.0.1 | ||
env: | ||
SKIP: no-commit-to-branch | ||
|
||
- name: Update pip and install dependencies | ||
id: install-dependencies | ||
run: python -m pip install --upgrade pip && pip install --no-deps -r ./lock/requirements-dev.txt | ||
|
||
- name: Run ruff | ||
id: ruff | ||
run: | | ||
ruff check --output-format=github . | ||
ruff format --check . | ||
- name: Run mypy | ||
id: mypy | ||
run: | | ||
mypy . | ||
- name: Check license header and file | ||
id: license-checker | ||
run: | | ||
./scripts/check_license.py |
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
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
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
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
Oops, something went wrong.