summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 0133864dfe2c6b14db1c9da3d65a8df0d0f4136d (plain)
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
image: derfnull/ci-dfatool:2022.05.22

stages:
  - test
  - build
  - deploy

run_tests:
  stage: test
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
  - mkdir test-data
  - wget -qO test-data/20161221_123347_mmparam.tar https://lib.finalrewind.org/energy-models/20161221_123347_mmparam.tar
  - wget -qO test-data/20170116_124500_LM75x.tar https://lib.finalrewind.org/energy-models/20170116_124500_LM75x.tar
  - wget -qO test-data/20170116_131306_LM75x.tar https://lib.finalrewind.org/energy-models/20170116_131306_LM75x.tar
  - wget -qO test-data/20170116_142654_mmstatic.tar https://lib.finalrewind.org/energy-models/20170116_142654_mmstatic.tar
  - wget -qO test-data/20170116_143516_mmstatic.tar https://lib.finalrewind.org/energy-models/20170116_143516_mmstatic.tar
  - wget -qO test-data/20170116_145420_sharpLS013B4DN.tar https://lib.finalrewind.org/energy-models/20170116_145420_sharpLS013B4DN.tar
  - wget -qO test-data/20170116_151348_sharpLS013B4DN.tar https://lib.finalrewind.org/energy-models/20170116_151348_sharpLS013B4DN.tar
  - wget -qO test-data/20170220_164723_RF24_int_A.tar https://lib.finalrewind.org/energy-models/20170220_164723_RF24_int_A.tar
  - wget -qO test-data/20190815_103347_nRF24_no-rx.json https://lib.finalrewind.org/energy-models/20190815_103347_nRF24_no-rx.json
  - wget -qO test-data/20190815_111745_nRF24_no-rx.json https://lib.finalrewind.org/energy-models/20190815_111745_nRF24_no-rx.json
  - wget -qO test-data/20190815_122531_nRF24_no-rx.json https://lib.finalrewind.org/energy-models/20190815_122531_nRF24_no-rx.json
  - wget -qO test-data/20191024-150723-nrf24l01-var-ack-retry.tar https://lib.finalrewind.org/energy-models/20191024-150723-nrf24l01-var-ack-retry.tar
  - wget -qO test-data/20191024-152648-nrf24l01-var-ack.tar https://lib.finalrewind.org/energy-models/20191024-152648-nrf24l01-var-ack.tar
  - wget -qO test-data/20200722-113624-timedResistiveLoad.tar https://lib.finalrewind.org/energy-models/20200722-113624-timedResistiveLoad.tar
  - wget -qO test-data/20201203-112341-et_la_dco.tar https://lib.finalrewind.org/energy-models/20201203-112341-et_la_dco.tar
  - wget -qO test-data/20201203-110526-et_timer_dco.tar https://lib.finalrewind.org/energy-models/20201203-110526-et_timer_dco.tar
  - wget -qO test-data/20201203-113313-et_la_hfxt0.tar https://lib.finalrewind.org/energy-models/20201203-113313-et_la_hfxt0.tar
  - wget -qO test-data/20201203-114004-et_timer_hfxt0.tar https://lib.finalrewind.org/energy-models/20201203-114004-et_timer_hfxt0.tar
  - pytest-3 --cov=lib
  - python3-coverage html -i
  artifacts:
    paths:
    - htmlcov/
    expire_in: 1 week

make_benchmark:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
  - mkdir kconfig-static-data
  - cd kconfig-static-data
  - ../bin/explore-kconfig.py --log-level debug --random 5 --with-neighbourhood ../examples/kconfig-static
  - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 DFATOOL_KCONF_WITH_CHOICE_NODES=0 ../bin/analyze-kconfig.py --export-webconf example-static-rmt.json ../examples/kconfig-static/Kconfig .
  - cp ../examples/kconfig-static/Kconfig example-static.kconfig
  artifacts:
    paths:
    - example-static.kconfig
    - example-static-rmt.json

make_model:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
  - wget -q https://ess.cs.uos.de/.private/dfatool/multipass.json.xz https://ess.cs.uos.de/.private/dfatool/multipass.kconfig
  - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py multipass.kconfig multipass.json.xz --export-webconf multipass-rmt.json
  - wget -q https://ess.cs.uos.de/.private/dfatool/x264.json.xz https://ess.cs.uos.de/.private/dfatool/x264.kconfig https://ess.cs.uos.de/.private/dfatool/x264.nfpkeys.json
  - mv x264.nfpkeys.json nfpkeys.json
  - DFATOOL_DTREE_SKLEARN_CART=1 DFATOOL_PARAM_CATEGORIAL_TO_SCALAR=1 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf x264-cart.json
  - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf x264-rmt.json
  artifacts:
    paths:
    - multipass-rmt.json
    - x264.kconfig
    - x264-cart.json
    - x264-rmt.json

deploy_model:
  stage: deploy
  image: debian:bullseye
  before_script:
    - apt-get -y update
    - apt-get -y install lftp
    - mkdir -p ~/.ssh
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
    - chmod 600 "$STAGING_PRIVATE_KEY"
  script:
    - lftp -e "set sftp:connect-program 'ssh -a -x -i $STAGING_PRIVATE_KEY'; mkdir -p -f /dfatool/$CI_COMMIT_REF_NAME; put -e -O dfatool/$CI_COMMIT_REF_NAME x264.kconfig x264-cart.json x264-rmt.json; quit" --password invalid sftp://ci-deploy@ess.cs.uos.de