-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#13] make CI jobs more consistent with open-api-framework related pr…
…ojects (#129) --------- Co-authored-by: Sonny Bakker <sonny@maykinmedia.nl>
- Loading branch information
Showing
24 changed files
with
360 additions
and
473 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,23 @@ | ||
name: check-oas | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/objecttypes/api/*/openapi.yaml" | ||
- .github/workflows/oas-check.yml | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
open-api-workflow-check-oas: | ||
uses: maykinmedia/open-api-workflows/.github/workflows/oas-check.yml@v1 | ||
strategy: | ||
matrix: | ||
version: | ||
- v2 | ||
with: | ||
schema-path: 'src/objecttypes/api/${{ matrix.version }}/openapi.yaml' | ||
python-version: '3.11' | ||
django-settings-module: 'objecttypes.conf.ci' | ||
apt-packages: 'libgdal-dev gdal-bin' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,28 @@ | ||
name: code-quality | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
- '**.yml' | ||
pull_request: | ||
paths: | ||
- '**.py' | ||
- '**.yml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
isort: | ||
name: Check import sorting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- uses: isort/isort-action@v1 | ||
with: | ||
requirementsFiles: requirements/dev.txt | ||
sortPaths: "src" | ||
configuration: '--check-only --diff' | ||
|
||
black: | ||
name: Check code formatting with black | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements/dev.txt | ||
- name: Run black | ||
run: | | ||
black --check src | ||
oas-up-to-date: | ||
name: Check for unexpected OAS changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install system packages | ||
run: | | ||
sudo apt-get update \ | ||
&& sudo apt-get install -y --no-install-recommends \ | ||
libgdal-dev \ | ||
gdal-bin | ||
- name: Install dependencies | ||
run: pip install -r requirements/ci.txt | ||
|
||
- name: Generate OAS files | ||
run: ./bin/generate_schema.sh openapi.yaml | ||
env: | ||
DJANGO_SETTINGS_MODULE: objecttypes.conf.ci | ||
|
||
- name: Check for OAS changes | ||
run: | | ||
diff openapi.yaml src/objecttypes/api/v2/openapi.yaml | ||
- name: Write failure markdown | ||
if: ${{ failure() }} | ||
run: | | ||
echo 'Run the following command locally and commit the changes' >> $GITHUB_STEP_SUMMARY | ||
echo '' >> $GITHUB_STEP_SUMMARY | ||
echo '```bash' >> $GITHUB_STEP_SUMMARY | ||
echo './bin/generate_schema.sh' >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
open-api-workflow-code-quality: | ||
uses: maykinmedia/open-api-workflows/.github/workflows/code-quality.yml@v1 | ||
with: | ||
apt-packages: 'libgdal-dev gdal-bin' | ||
python-version: '3.11' | ||
node-version: '18' | ||
postgres-image: 'postgres:12' | ||
|
||
black-src-pattern: 'src' | ||
|
||
django-settings-module: 'objecttypes.conf.ci' | ||
django-secret-key: dummy |
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.