|
63 | 63 | - name: Publish coverage report
|
64 | 64 | uses: codecov/codecov-action@v3
|
65 | 65 |
|
66 |
| - generate-oas-files: |
67 |
| - name: Generate and upload OAS files for all versions |
68 |
| - needs: tests |
69 |
| - runs-on: ubuntu-latest |
70 |
| - strategy: |
71 |
| - matrix: |
72 |
| - version: ['v1', 'v2'] |
73 |
| - steps: |
74 |
| - - uses: actions/checkout@v4 |
75 |
| - - uses: actions/setup-python@v5 |
76 |
| - with: |
77 |
| - python-version: '3.10' |
78 |
| - - uses: actions/setup-node@v4 |
79 |
| - with: |
80 |
| - node-version: '18' |
81 |
| - |
82 |
| - - name: Install system packages |
83 |
| - run: | |
84 |
| - sudo apt-get update \ |
85 |
| - && sudo apt-get install -y --no-install-recommends \ |
86 |
| - libgdal-dev \ |
87 |
| - gdal-bin |
88 |
| -
|
89 |
| - - name: Install dependencies |
90 |
| - run: pip install -r requirements/ci.txt codecov |
91 |
| - |
92 |
| - - name: Generate OAS files |
93 |
| - run: ./bin/generate_schema.sh ${{ matrix.version }} openapi-${{ matrix.version }}.yaml |
94 |
| - env: |
95 |
| - DJANGO_SETTINGS_MODULE: objects.conf.ci |
96 |
| - |
97 |
| - - name: Store generated OAS files |
98 |
| - uses: actions/upload-artifact@v4 |
99 |
| - with: |
100 |
| - name: objects-api-${{ matrix.version }}-oas |
101 |
| - path: openapi-${{ matrix.version }}.yaml |
102 |
| - retention-days: 1 |
103 |
| - |
104 |
| - oas-up-to-date: |
105 |
| - name: Check for unexepected OAS changes |
106 |
| - needs: generate-oas-files |
107 |
| - runs-on: ubuntu-latest |
108 |
| - strategy: |
109 |
| - matrix: |
110 |
| - version: ['v1', 'v2'] |
111 |
| - steps: |
112 |
| - - uses: actions/checkout@v4 |
113 |
| - - name: Download generated OAS |
114 |
| - uses: actions/download-artifact@v4 |
115 |
| - with: |
116 |
| - name: objects-api-${{ matrix.version }}-oas |
117 |
| - - name: Check for OAS changes |
118 |
| - run: | |
119 |
| - diff openapi-${{ matrix.version }}.yaml src/objects/api/${{ matrix.version }}/openapi.yaml |
120 |
| - - name: Write failure markdown |
121 |
| - if: ${{ failure() }} |
122 |
| - run: | |
123 |
| - echo 'Run the following command locally and commit the changes' >> $GITHUB_STEP_SUMMARY |
124 |
| - echo '' >> $GITHUB_STEP_SUMMARY |
125 |
| - echo '```bash' >> $GITHUB_STEP_SUMMARY |
126 |
| - echo './bin/generate_schema.sh ${{ matrix.version }}' >> $GITHUB_STEP_SUMMARY |
127 |
| - echo '```' >> $GITHUB_STEP_SUMMARY |
128 |
| -
|
129 | 66 | docker:
|
130 | 67 | needs: tests
|
131 | 68 |
|
|
0 commit comments