Skip to content

Punktsamling 2: Tilføjelser til fire info kommandogruppen #656

Punktsamling 2: Tilføjelser til fire info kommandogruppen

Punktsamling 2: Tilføjelser til fire info kommandogruppen #656

Workflow file for this run

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/2340000/instantclient-basic-linux.x64-23.4.0.24.05.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/2340000/instantclient-sqlplus-linux.x64-23.4.0.24.05.zip
unzip -o instantclient-basic-linux.x64-23.4.0.24.05.zip
unzip -o instantclient-sqlplus-linux.x64-23.4.0.24.05.zip
ls -la /opt/oracle/instantclient_23_4
sudo apt-get install libaio1
sudo sh -c "echo /opt/oracle/instantclient_23_4 > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
export LD_LIBRARY_PATH=/opt/oracle/instantclient_23_4:$LD_LIBRARY_PATH
export PATH=/opt/oracle/instantclient_23_4:$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@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: |
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)