Merge pull request #462 from maykinmedia/release/2.4.4 #964
Workflow file for this run
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
name: code-quality | |
on: [push] | |
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 docs" | |
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 docs | |
oas-up-to-date: | |
name: Check for unexepected OAS changes | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: ['v1', 'v2'] | |
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 ${{ matrix.version }} openapi-${{ matrix.version }}.yaml | |
env: | |
DJANGO_SETTINGS_MODULE: objects.conf.ci | |
- name: Check for OAS changes | |
run: | | |
diff openapi-${{ matrix.version }}.yaml src/objects/api/${{ matrix.version }}/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 ${{ matrix.version }}' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY |