-
Notifications
You must be signed in to change notification settings - Fork 5
reusable-workflow #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
reusable-workflow #215
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d989a1e
reusable-workflow
ChristianBeilschmidt bbd0173
typo
ChristianBeilschmidt 29c7262
if typo
ChristianBeilschmidt 60e2f00
ticks
ChristianBeilschmidt 7be0302
exclude hidden dirs from linting
ChristianBeilschmidt 20658a5
mypy
ChristianBeilschmidt 8d887b4
mypy
ChristianBeilschmidt 331b6e1
mypy
ChristianBeilschmidt bea9557
mypy
ChristianBeilschmidt 2c41de6
unused file
ChristianBeilschmidt f943880
venv
ChristianBeilschmidt 4c210f7
coverage on push to main
ChristianBeilschmidt 23b56ba
add descriptions
ChristianBeilschmidt fa63ead
backend fixed?
ChristianBeilschmidt 6c9038e
backend ref
ChristianBeilschmidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 +1 @@ | ||
| main | ||
| c4af2b856f9205ce9848d5b9695cf4710c25e83f |
This file contains hidden or 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 hidden or 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,153 @@ | ||
| name: Test Python Library | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| python-version: | ||
| type: string | ||
| required: true | ||
| description: 'Python version to use, e.g., "3.9"' | ||
| use-uv: | ||
michaelmattig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: boolean | ||
| default: false | ||
| description: 'Use `uv` for minimum version resolution' | ||
| coverage: | ||
| type: boolean | ||
| default: false | ||
| description: 'Generate coverage report' | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgis/postgis | ||
| env: | ||
| POSTGRES_USER: geoengine | ||
| POSTGRES_PASSWORD: geoengine | ||
| POSTGRES_DB: geoengine | ||
| ports: | ||
| - 5432:5432 | ||
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: library | ||
|
|
||
| steps: | ||
| - name: Checkout library code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: library | ||
| - name: Setup variables | ||
| id: vars | ||
| run: | | ||
| echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT | ||
| if ${{ inputs.use-uv }}; then | ||
| echo "PIP_INSTALL=uv pip install --resolution=lowest-direct" >> $GITHUB_OUTPUT | ||
| echo "VENV_CALL=source .venv/bin/activate" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "PIP_INSTALL=pip install" >> $GITHUB_OUTPUT | ||
| echo "VENV_CALL=" >> $GITHUB_OUTPUT | ||
| fi | ||
| if ${{ inputs.coverage }}; then | ||
| echo "COVERAGE_COMMAND=--cov=geoengine --cov-report=lcov" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "COVERAGE_COMMAND=" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Checkout Geo Engine code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: geo-engine/geoengine | ||
| ref: ${{ steps.vars.outputs.GEOENGINE_VERSION }} | ||
| path: backend | ||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/free-disk-space@main | ||
| with: | ||
| tool-cache: true | ||
| android: true | ||
| dotnet: true | ||
| haskell: true | ||
| large-packages: true | ||
| docker-images: true | ||
| swap-storage: true | ||
| - name: Install lld & GDAL & Protobuf | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev | ||
| sudo apt-get clean | ||
| export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH | ||
| export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH | ||
| sudo ldconfig | ||
| - name: Install Rustup | ||
| run: | | ||
| curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y | ||
| echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH | ||
| - name: Set up Python ${{ inputs.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
| - name: Upgrade PIP | ||
| run: python -m pip install --upgrade pip | ||
| - name: Setup UV and create venv | ||
| if: ${{ inputs.use-uv }} | ||
| run: | | ||
| pip install uv | ||
| uv venv | ||
| - name: Install build dependencies | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| ${{ steps.vars.outputs.PIP_INSTALL }} -e .[dev] | ||
| - name: Check Formatting | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m pycodestyle | ||
| - name: Lint code | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m pylint geoengine | ||
| - name: Type-check code | ||
| # mypy seems buggy with uv | ||
| if: ${{ !inputs.use-uv }} | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m mypy geoengine | ||
| - name: Build | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m build . | ||
| - name: Install test dependencies | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| ${{ steps.vars.outputs.PIP_INSTALL }} -e .[test] | ||
| - name: Lint tests | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m pylint tests | ||
| - name: Type-check tests | ||
| # mypy seems buggy with uv | ||
| if: ${{ !inputs.use-uv }} | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| python -m mypy tests | ||
| - name: Test | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| pytest ${{ steps.vars.outputs.COVERAGE_COMMAND }} | ||
| env: | ||
| GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend | ||
| GEOENGINE_TEST_BUILD_TYPE: "release" | ||
| - name: Upload coverage to Coveralls | ||
| if: ${{ inputs.coverage }} | ||
| uses: coverallsapp/github-action@v2 | ||
| with: | ||
| base-path: library | ||
| - name: Examples | ||
| run: | | ||
| ${{ steps.vars.outputs.VENV_CALL }} | ||
| ${{ steps.vars.outputs.PIP_INSTALL }} -e .[examples] | ||
| python test_all_notebooks.py | ||
| env: | ||
| GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend | ||
| GEOENGINE_TEST_BUILD_TYPE: "release" | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ __pycache__ | |
| # Virtual Environments | ||
| env | ||
| env-* | ||
| .venv | ||
|
|
||
| # Private files | ||
| .pypirc | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.