Skip to content

Commit

Permalink
Merge branch 'main' into renovate/configure
Browse files Browse the repository at this point in the history
  • Loading branch information
nadzyah authored Jan 22, 2024
2 parents d1153db + c54b94f commit 974a1d0
Show file tree
Hide file tree
Showing 29 changed files with 4,870 additions and 14 deletions.
40 changes: 40 additions & 0 deletions .code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"folders": [
{
"name": "Server",
"path": "server",
"extensions": {
"recommendations": [
"ms-python.python"
]
},
"settings": {
"python.pythonPath": "server/.venv/bin/python"
}
},
{
"name": "hwctl",
"path": "client/hwctl",
"extensions": {
"recommendations": [
"matklad.rust-analyzer"
]
},
"settings": {
"rust-analyzer.linkedProjects": ["client/hwctl/Cargo.toml"]
}
},
{
"name": "hwlib",
"path": "client/hwlib",
"extensions": {
"recommendations": [
"matklad.rust-analyzer"
]
},
"settings": {
"rust-analyzer.linkedProjects": ["client/hwlib/Cargo.toml"]
}
}
]
}
49 changes: 49 additions & 0 deletions .github/workflows/test_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test API server
on: [push]
# Cancel inprogress runs if new commit pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: [self-hosted, linux, large]
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: Gr1N/setup-poetry@12c727a3dcf8c1a548d8d041c9d5ef5cebb3ba2e
with:
poetry-version: "1.6.1"
- run: poetry install
- run: poetry run black --check hwapi
- run: poetry run ruff hwapi
- run: poetry run mypy hwapi

compare-openapi:
runs-on: [self-hosted, linux, large]
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: Gr1N/setup-poetry@12c727a3dcf8c1a548d8d041c9d5ef5cebb3ba2e
with:
poetry-version: "1.6.1"
- run: poetry install
- name: Start FastAPI application
run: poetry run uvicorn hwapi.main:app --port 8001 &
shell: bash

- name: Fetch OpenAPI YAML
run: curl http://localhost:8001/openapi.yaml -o fetched_openapi.yaml

- name: Compare with repository's openapi.yaml
run: diff fetched_openapi.yaml openapi.yaml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: local
hooks:
- id: openapi-fetch
name: Fetch OpenAPI YAML
entry: scripts/fetch_openapi.sh
language: script
always_run: true
pass_filenames: false
Loading

0 comments on commit 974a1d0

Please sign in to comment.