Tilføj database-views mhp brug i QGIS #528
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: API/CLI | |
on: [push, pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
services: | |
oracledb: | |
image: gvenzl/oracle-xe:full | |
env: | |
ORACLE_PASSWORD: oracle | |
ports: | |
- 1521:1521 | |
options: >- | |
--health-cmd healthcheck.sh | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Cache Oracle instantclient | |
uses: actions/cache@v3 | |
id: oracle_cache | |
env: | |
# Increase this value to reset cache if environment-dev.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/oracle | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('scripts/get_oracle_pkgs.sh') }} | |
- name: Download Oracle .rpm'er og oversæt til .deb | |
if: steps.oracle_cache.outputs.cache-hit != 'true' | |
run: | | |
sudo apt-get install alien libaio1 | |
mkdir -p ~/oracle | |
cd ~/oracle | |
sh $GITHUB_WORKSPACE/scripts/get_oracle_pkgs.sh | |
cd $GITHUB_WORKSPACE | |
- name: Installer Oracle instantclient et al | |
run: | | |
sudo dpkg -i ~/oracle/oracle-instantclient19.13-basic_19.13.0.0.0-2_amd64.deb | |
sudo dpkg -i ~/oracle/oracle-instantclient19.13-sqlplus_19.13.0.0.0-2_amd64.deb | |
sudo sh -c "echo /usr/lib/oracle/19.13/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf" | |
sudo ldconfig | |
- name: Forbered conda environment | |
run: | | |
sed -i '/bzip2/d' environment-dev.yml | |
cat environment-dev.yml | |
- name: Cache conda | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if environment-dev.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment-dev.yml') }} | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
environment-file: environment-dev.yml | |
auto-activate-base: false | |
activate-environment: fire-dev | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- run: | | |
conda info | |
conda list | |
- name: Installer FIRE | |
run: | | |
pip install -e . | |
cp test/ci/fire.ini ~/fire.ini | |
- name: Populer database | |
run: | | |
sqlplus64 -V | |
# Opsæt database | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus64 -S system/oracle@//localhost:1521/XEPDB1 @test/ci/init.sql | |
# Indlæs DDL | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus64 -S fire/fire@//localhost:1521/XEPDB1 @sql/ddl.sql | |
# Indlæs Views | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus64 -S fire/fire@//localhost:1521/XEPDB1 @sql/views.sql | |
# Indlæs testdata | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus64 -S fire/fire@//localhost:1521/XEPDB1 @test/sql/testdata.sql | |
# Indlæst opmålingsdistrikter | |
python scripts/load_shapefile.py | |
- name: Testsuite | |
run: | | |
pytest --cov=fire --cov-report=xml --ignore=test/read/ --ignore=test/write/ | |
bash <(curl -s https://codecov.io/bash) |