-
Notifications
You must be signed in to change notification settings - Fork 8
105 lines (83 loc) · 3.41 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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@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)