|
18 | 18 |
|
19 | 19 | jobs: |
20 | 20 | check: |
21 | | - runs-on: ubuntu-22.04 |
22 | | - |
23 | | - services: |
24 | | - postgres: |
25 | | - image: postgis/postgis |
26 | | - env: |
27 | | - POSTGRES_USER: geoengine |
28 | | - POSTGRES_PASSWORD: geoengine |
29 | | - POSTGRES_DB: geoengine |
30 | | - ports: |
31 | | - - 5432:5432 |
32 | | - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + container: quay.io/geoengine/devcontainer:latest |
33 | 23 |
|
34 | 24 | defaults: |
35 | 25 | run: |
|
46 | 36 | echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT |
47 | 37 | if ${{ inputs.use-uv }}; then |
48 | 38 | echo "PIP_INSTALL=uv pip install --resolution=lowest-direct" >> $GITHUB_OUTPUT |
49 | | - echo "VENV_CALL=source .venv/bin/activate" >> $GITHUB_OUTPUT |
| 39 | + echo "VENV_CALL=. .venv/bin/activate" >> $GITHUB_OUTPUT |
50 | 40 | else |
51 | | - echo "PIP_INSTALL=pip install" >> $GITHUB_OUTPUT |
| 41 | + echo "PIP_INSTALL=python -m pip install" >> $GITHUB_OUTPUT |
52 | 42 | echo "VENV_CALL=" >> $GITHUB_OUTPUT |
53 | 43 | fi |
54 | 44 | if ${{ inputs.coverage }}; then |
|
62 | 52 | repository: geo-engine/geoengine |
63 | 53 | ref: ${{ steps.vars.outputs.GEOENGINE_VERSION }} |
64 | 54 | path: backend |
65 | | - - name: Free Disk Space (Ubuntu) |
66 | | - uses: jlumbroso/free-disk-space@main |
67 | | - with: |
68 | | - tool-cache: true |
69 | | - android: true |
70 | | - dotnet: true |
71 | | - haskell: true |
72 | | - large-packages: true |
73 | | - docker-images: true |
74 | | - swap-storage: true |
75 | | - - name: Install lld & GDAL & Protobuf |
76 | | - run: | |
77 | | - sudo apt-get update |
78 | | - sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev |
79 | | - sudo apt-get clean |
80 | | - export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH |
81 | | - export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH |
82 | | - sudo ldconfig |
83 | | - - name: Install Rustup |
84 | | - run: | |
85 | | - curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y |
86 | | - echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH |
87 | 55 | - name: Set up Python ${{ inputs.python-version }} |
88 | 56 | uses: actions/setup-python@v4 |
89 | 57 | with: |
|
93 | 61 | - name: Setup UV and create venv |
94 | 62 | if: ${{ inputs.use-uv }} |
95 | 63 | run: | |
96 | | - pip install uv |
| 64 | + python -m pip install uv |
97 | 65 | uv venv |
98 | 66 | - name: Install build dependencies |
99 | 67 | run: | |
@@ -133,16 +101,23 @@ jobs: |
133 | 101 | python -m mypy tests |
134 | 102 | - name: Test |
135 | 103 | run: | |
| 104 | + service postgresql start |
136 | 105 | ${{ steps.vars.outputs.VENV_CALL }} |
137 | 106 | pytest ${{ steps.vars.outputs.COVERAGE_COMMAND }} |
138 | 107 | env: |
139 | 108 | GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend |
140 | 109 | GEOENGINE_TEST_BUILD_TYPE: "release" |
141 | | - - name: Upload coverage to Coveralls |
| 110 | + - name: Report coverage to Coveralls |
142 | 111 | if: ${{ inputs.coverage }} |
143 | | - uses: coverallsapp/github-action@v2 |
144 | | - with: |
145 | | - base-path: library |
| 112 | + # 1. We need to adjust the paths in the lcov file to match the repository structure. |
| 113 | + # 2. We need to download the coveralls script and upload the report. |
| 114 | + run: | |
| 115 | + sed -i 's|SF:geoengine/|SF:|' ../coverage.lcov |
| 116 | + curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls report ../coverage.lcov |
| 117 | + # If we don't run it in the code folder, the paths in the report will prefixed with `library/geoengine/`. |
| 118 | + working-directory: library/geoengine |
| 119 | + env: |
| 120 | + COVERALLS_REPO_TOKEN: ${{ github.token }} |
146 | 121 | - name: Examples |
147 | 122 | run: | |
148 | 123 | ${{ steps.vars.outputs.VENV_CALL }} |
|
0 commit comments