Undlad oprettelse af landsnumre for punkter udenfor DK #737
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: Installer Oracle instantclient et al | |
run: | | |
mkdir -p /opt/oracle | |
cd /opt/oracle | |
# Download links findes her: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html | |
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linuxx64.zip | |
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linuxx64.zip | |
unzip -o instantclient-basic-linuxx64.zip | |
unzip -o instantclient-sqlplus-linuxx64.zip | |
# Oracle koder versionsnummeret ind i mappenavnet, fx "instantclient_23_6", selv når man henter "latest"-pakken | |
# Derfor omdøbes den som første skridt herunder. | |
mv instantclient_* instantclient | |
ls -la /opt/oracle/instantclient | |
sudo apt-get install libaio1t64 | |
# Ubuntu har med version 24.04 ændret navnet på libaio1 pakken og tilhørende .so-fil. | |
# Det har Oracle selvfølgelig ikke lige taget højde for, så vi hjælper lidt ved at pege | |
# et symlink i retning af den nye .so-fil. | |
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 | |
sudo sh -c "echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf" | |
sudo ldconfig | |
export LD_LIBRARY_PATH=/opt/oracle/instantclient:$LD_LIBRARY_PATH | |
export PATH=/opt/oracle/instantclient:$PATH | |
# Gem miljøvariable til brug i de følgende trin | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> "$GITHUB_ENV" | |
echo "PATH=$PATH" >> "$GITHUB_ENV" | |
which sqlplus | |
- 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@v3 | |
with: | |
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: | | |
sqlplus -V | |
# Opsæt database | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus -S system/oracle@//localhost:1521/XEPDB1 @test/ci/init.sql | |
# Indlæs DDL | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus -S fire/fire@//localhost:1521/XEPDB1 @sql/ddl.sql | |
# Indlæs Views | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus -S fire/fire@//localhost:1521/XEPDB1 @sql/views.sql | |
# Indlæs testdata | |
NLS_LANG=.AL32UTF8 ORACLE_PATH="${GITHUB_WORKSPACE}/misc/oracle" sqlplus -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) |