forked from SDFIdk/FIRE
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (90 loc) · 3.28 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
106
107
108
109
110
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 '/msys2/d' environment-dev.yml
sed -i '/m2-zip/d' environment-dev.yml
sed -i '/qgis/d' environment-dev.yml
- name: Cache conda
uses: actions/cache@v2
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:
environment-file: environment-dev.yml
python-version: 3.9
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 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)