|
31 | 31 |
|
32 | 32 |
|
33 | 33 | jobs:
|
| 34 | + |
| 35 | + validateVersion: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - uses: actions/setup-python@v5 |
| 41 | + with: |
| 42 | + python-version: '3.10' |
| 43 | + |
| 44 | + - name: Validate tag version |
| 45 | + if: ${{ startsWith(github.ref, 'refs/tags') }} |
| 46 | + run: | |
| 47 | + PYTHON_VERSION=$(grep -E '\bversion\s?=\s?"[^"]+"' pyproject.toml | awk -F '"' '{print $2}') |
| 48 | + echo "Tag version is [${{ steps.version.outputs.version }}], Python version is [$PYTHON_VERSION]" |
| 49 | + if [ "${{ steps.version.outputs.version }}" != "$PYTHON_VERSION" ]; then |
| 50 | + echo "Version mismatch; tag version is [${{ steps.version.outputs.version }}] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | +
|
34 | 54 | lint:
|
| 55 | + needs: validateVersion |
35 | 56 | if: github.repository == 'ckan/ckanext-xloader'
|
36 | 57 | runs-on: ubuntu-latest
|
37 | 58 | steps:
|
38 | 59 | - uses: actions/checkout@v4
|
| 60 | + |
39 | 61 | - uses: actions/setup-python@v5
|
40 | 62 | with:
|
41 | 63 | python-version: '3.10'
|
| 64 | + |
42 | 65 | - name: Install requirements
|
43 | 66 | run: pip install flake8 pycodestyle
|
| 67 | + |
44 | 68 | - name: Check syntax
|
45 | 69 | run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --extend-exclude ckan
|
46 | 70 |
|
@@ -148,16 +172,6 @@ jobs:
|
148 | 172 | - name: Checkout repository
|
149 | 173 | uses: actions/checkout@v4
|
150 | 174 |
|
151 |
| - - name: Validate tag version |
152 |
| - if: ${{ startsWith(github.ref, 'refs/tags') }} |
153 |
| - run: | |
154 |
| - PYTHON_VERSION=$(grep -E "\bversion='[^']+'" setup.py | awk -F "'" '{print $2}') |
155 |
| - echo "Tag version is [${{ steps.version.outputs.version }}], Python version is [$PYTHON_VERSION]" |
156 |
| - if [ "${{ steps.version.outputs.version }}" != "$PYTHON_VERSION" ]; then |
157 |
| - echo "Version mismatch; tag version is [${{ steps.version.outputs.version }}] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY |
158 |
| - exit 1 |
159 |
| - fi |
160 |
| -
|
161 | 175 | - name: Build package ${{ steps.version.outputs.reponame }} @ ${{ steps.version.outputs.version }}
|
162 | 176 | run: |
|
163 | 177 | pip install build
|
|
0 commit comments